0

I'm trying to access the spreadjs canvas for one of my automation project with selenium java

This is code snippet I'm using for the same

URL: https://developer.mescius.com/spreadjs/demos/features/table-sheet/overview/purejs

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("window.testSpread = new GC.Spread.Sheets.findControl(document.querySelector(\"[gcuielement=\'gcWorksheetCanvas\']\"))");
Object value = js.executeScript("return window.testSpread.getActiveSheet().getValue(0,0,);");

Getting the below error while running the code

org.openqa.selenium.JavascriptException: javascript error: window.testSpread.getActiveSheet is not a function
2
  • .getValue(0,0,) - There is an extra comma(,).
    – Shawn
    Commented Feb 20, 2024 at 13:39
  • removed but still not working
    – Amal M
    Commented Feb 22, 2024 at 12:47

1 Answer 1

0

can you console.log the value of window.testSpread? also, note that findControl is a static function, no "new" spread = GC.Spread.Sheets.findControl(host);

1
  • It showing undefined even after removing the new keyword
    – Amal M
    Commented Feb 22, 2024 at 12:46

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.