Posted 4 January 2024, 7:50 am EST
We use selenium4 for automated testing. How to select the row of data by clicking the line number of a certain line specified by spreadjsjs in selenium4?
Forums Home / Spread / SpreadJS
Posted by: kaisaint on 4 January 2024, 7:50 am EST
Posted 4 January 2024, 7:50 am EST
We use selenium4 for automated testing. How to select the row of data by clicking the line number of a certain line specified by spreadjsjs in selenium4?
Posted 5 January 2024, 10:23 am EST
Hi,
The SpeadSheet is drawn on the canvas. And for clicking on a cell, you will require the cell co-ordinates and then you could perform the click operation on the specified coordinates.
You could use the getCellRect method to get the rectangle of the cell. Then use the Selenium APIs to perform the click action.
getCellRect method: https://developer.mescius.com/spreadjs/api/v17/classes/GC.Spread.Sheets.Worksheet#getcellrect
Regards,
Ankit
Posted 5 January 2024, 10:56 am EST
we need to click the row number,after click the row number,it will get data from backend service
Posted 8 January 2024, 6:17 am EST - Updated 8 January 2024, 6:22 am EST
Hi,
As Ankit suggested you need to click on the x, and y coordinates of the cells. To get the coordinates you could use the getCellRect method. Please refer to the following attached sample that opens a spreadJS application and select Row 6 Column A using selenium.
For Chrome Driver please download it here: https://chromedriver.storage.googleapis.com/index.html?path=114.0.5735.90/
Regards,
Avinash
SaleniumTest.zip
Posted 11 January 2024, 9:55 am EST
Our spreadjs uses version 15, there is no designer, and our spreadjs is on canvas, which is part of the entire web page. and we use java
Posted 12 January 2024, 7:44 am EST
Hi,
The SpreadSheet is drawn on a canvas and in order to click on a cell for testing, you need to get the cell coordinates using SpreadJS APIs and then perform the click on the cell Coordinates using the Selenium APIs.
As mentioned earlier, you could use the getCellRect() method to get the coordinates of a cell. Once you get the coordinates, perform the click using Selenium API. The process will be same for the Designer as well as SpreadJS and you could use the same approach with SpreadJS V15 as well as SpreadJS V17 (latest).
I am not sure about the issue you are facing. Could you kindly elaborate the issue you are facing? If you want to get certain information (like Cell Coorindates) from the SpreadJS, we could provide APIs for the same (like getCellRect()) method. Further, if any other information is required from the SpreadJS, kindly let us know.
Further, I could provide the support related to our product SpreadJS and Selenium Testing using Java is beyond our support scope. If you require assistance with the SpreadJS part, do let us know.
Regards,
Ankit