How to enter an Integer in a table cell

34 views
Skip to first unread message

Attila

unread,
Apr 17, 2018, 3:00:28 PM4/17/18
to Selenium Users
I have my cell element:  IWebElement cell = tdElements[colIndex];

How to enter an integer r double into the cell.

I have read that you have to use the IJavaScriptExecutor.  However, everything seems to point to having to pass a locator to the script.   I already have the cell, how to pass a number to it.  The inner text of the cell doesn't take a string.


Thanks in advance.

Attila

unread,
Apr 17, 2018, 8:05:36 PM4/17/18
to Selenium Users
I'm using c#

Attila

unread,
Apr 18, 2018, 2:53:28 PM4/18/18
to Selenium Users
Boy! replies are slow on this site.  I resolved my problem.  The cell I needed to alter was really a div inside of a cell.  I couldn't see the div until I double-clicked on the cell.  So to resolve my problem:
1- I found the cell
2- I moved to cell and double-clicked with an action
3- I discover and find the div
4- I click on the div
5- I clear the div
6- I send string to the div
7- i send the Enter key to div to store the value in server (this is needed in my application)
8- released action

PS: Strings and Integers were accepted since conversion is done at the server.
Reply all
Reply to author
Forward
0 new messages