P
P
Potursak2014-01-16 05:50:07
C++ / C#
Potursak, 2014-01-16 05:50:07

Entering values ​​into table Selenium WebDriver + C#

Please help.
I write autotests. Browser - Chrome.
There is an empty table, you need to enter data in the cells of the table.
One cell is filled, its page code is:
Code:
< table >
< tr >
< td >
< div class=... >
< div class=PPTCellConText > 45 </div >
...
and the empty cell code is:
Code:
< table >
< tr >
< td >
< /td >
...
How to do this in C#?
I can get the data from the filled cell through getText(), but I can't enter the data.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Astafiev, 2014-11-20
@kentilini

The problem is that you have a div element. Which a priori does not provide for text input by hands / person. That's what input elements are for. And the setText() method will work for them.
How does the program behave? I assume that to fill the table you need to click on the cell, and then a field will appear that can be edited? If so, then this particular set of actions needs to be performed:
1) Click on the element
2) Find the element that appears and enter text into it using the setText() method
3) Remove focus from the element so that js changes the values ​​of the div element in the table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question