How to get typed text from a textbox by using Selenium Webdriver?

+1 vote
How to get typed text from a textbox by using Selenium Webdriver?
Jun 24, 2019 in Selenium by Ashmita
3,282 views

1 answer to this question.

+1 vote
Best answer

Hey Ashmita, to get the typed text from a textbox, you can use getAttribute(“value”) method by passing arg as value. Value attribute stores the typed text of the textbox element. See the following example to know better: 

String typedText = driver.findElement(By.xpath("xpath_textbox")).getAttribute("value"));
answered Jun 24, 2019 by Abha
• 27,780 points

selected Dec 31, 2019 by Kalgi
thanks for your valueable info and keep on doing like this ..it is really usefull
Hello, can you please upvote the answer if it has helped you?

Thanks :)

Related Questions In Selenium

0 votes
1 answer

How to get the text from a website using selenium?

hey, you can use get.text() method to ...READ MORE

answered Dec 31, 2018 in Selenium by Sudhanshu
4,177 views
0 votes
1 answer

How to get a page name using Selenium Webdriver (C#)?

I believe the below thing works: driver.Title; READ MORE

answered Sep 14, 2018 in Selenium by Martin
• 4,320 points
289 views
0 votes
1 answer

How to extract text from a web page using selenium and save it as a text file?

Hello Isha, you can checkout this code ...READ MORE

answered May 7, 2019 in Selenium by Anvi
• 14,010 points
8,787 views
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
1,818 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,870 points
1,620 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,870 points
1,479 views
0 votes
1 answer
0 votes
1 answer