How can I fetch value/text from a textbox by using Python Selenium Webdriver?

0 votes
How can I fetch value/text from a textbox by using Python Selenium Webdriver?
Jul 30 in Selenium by Jagat
25 views

1 answer to this question.

0 votes

Hey Jagat, following test script shows how to fetch value/text from a textbox using python selenium webdriver:

from selenium import webdriver

driver = webdriver.Firefox(executable_path=r"C:\Users\Abha_Rathour\Downloads\geckodriver\geckodriver.exe")
driver.implicitly_wait(2)
driver.maximize_window()

driver.get("https://www.gmail.com")

driver.find_element_by_id('identifierId').send_keys('abc.def@gmail.com')
text1 = driver.find_element_by_id('identifierId').get_property('value')

print(text1)
answered Jul 31 by Abha
• 22,960 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How can I clear the text in a text box using Selenium WebDriver?

Hello Akriti, you can clear the text ...READ MORE

answered May 29 in Selenium by Anvi
• 12,840 points
192 views
0 votes
1 answer
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8 in Selenium by Anvi
• 12,840 points
140 views
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,090 points
559 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,130 points
892 views
0 votes
1 answer
0 votes
1 answer

How can I select date from a datepicker div using Selenium Webdriver?

Hey Jeevika, you can use following automation ...READ MORE

answered Jul 15 in Selenium by Abha
• 22,960 points
58 views