Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I enter a value in TextBox or a Combobox and would like to retrieve the value I have just entered. I see that the Selenium Weblement method 'getText()' doesn't retrieve the value, it seems the entered text doesn't get pushed into DOM.

Any Solutions?

1 Answer

0 votes
by (62.9k points)

Try getValue if it is a Text Field or Dropdown box

String lastname=selenium.getValue("//*[@id='lastName']");

System.out.println(lastname);

Browse Categories

...