Skip to content
Related Articles
Open in App
Not now

Related Articles

Working with Input box/Test Box in Selenium with Python

Improve Article
Save Article
Like Article
  • Last Updated : 10 Jul, 2022
Improve Article
Save Article
Like Article

Selenium is an effective device for controlling an internet browser through the program. It is purposeful for all browsers, works on all fundamental OS and its scripts are written in numerous languages i.e Python, Java, C#, etc, we can be running with Python.

Requirement: You need to install chromedriver and set path. Click here to download, for more information follows this link.

Working with Input box/Test Box, let us how to:

  1. find how many input boxes present in the web page.
  2. provide value into text boxes.
  3. get the status.


  • Importing the modules.
  • We will load the URL in the driver.
  • Now select the XPath of the desired field by doing:

  • Then find(navigate) the class name where input is present.
  • Find the length using len().
  • Check the status by is_displayed().



# importing the modules
from selenium import webdriver
from import By
from selenium.webdriver.common.keys import Keys
import time
# using chrome driver
driver = webdriver.Chrome()
# web page url
# select class name where is input box are present
element = driver.find_elements(By.CLASS_NAME, "text_field")
# find number of input box
# fill value in input box
# check status
x = driver.find_element_by_xpath('//*[@id="RESULT_TextField-1"]').is_displayed()


My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!