
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 190 Articles for Selenium Web Driver

265 Views
There are multiple methods available for handling static dropdowns in a page in Selenium. The static dropdowns are an integral part of a web page. This type of UI elements are mostly developed for birthday or age selection on a page.A dropdown is not an element alone. It is a group of elements. For example for selection of birth date, we have multiple options to be selected for day, month and the year. Thus the approach is to first get the primary element and then move to its sub elements for selection.Select class is provided by the Selenium API which ... Read More

1K+ Views
We can count the total number of radio buttons in a page in Selenium with the help of find_elements method. While working on any radio buttons, we will always find an attribute type in the html code and its value should be radio.This characteristic is only applicable to radio buttons on that particular page and to no other types of UI elements like edit box, link and so on.To retrieve all the elements with attribute type = 'radio', we will use find_elements_by_xpath() method. This method returns a list of web elements with the type of xpath specified in the method ... Read More

2K+ Views
We can count the total number of checkboxes in a page in Selenium with the help of find_elements method. While working on any checkboxes, we will always find an attribute type in the html code and its value should be checkbox.This characteristic is only applicable to checkboxes on that particular page and to no other types of UI elements like edit box, link and so on.To retrieve all the elements with attribute type = 'checkbox', we will use find_elements_by_xpath() method. This method returns a list of web elements with the type of xpath specified in the method argument. In case ... Read More

7K+ Views
There are multiple ways of submitting a form in Selenium. One of the methods is to directly use the click() method on the form submitting button. The next approach is to use the submit() method on the form page.Using the submit() method.This method shall simply submit the form after the required data is entered on the form page.Syntax −driver.find_element_by_xpath("//input[class ='gsc-search']").submit()Using the click() method.This method shall click on the submit button of the form after the required data is entered on the form page.Syntax −driver.find_element_by_xpath("//button[id ='value']").click()ExampleCode Implementation with submit() method.from selenium import webdriver #browser exposes an executable file #Through Selenium test ... Read More

20K+ Views
We can enter text on any field in Selenium. After entering the text, we may need to remove or clear the text we entered in that field. This interaction with the web elements can be achieved with the help of clear() method.Thus a clear() method is used to clear or reset an input field belonging to a form/ edit box. It replaces the text content on that particular element of the page.Syntaxdriver.find_element_by_xpath("//input[class ='gsc-search']").clear()ExampleCode Implementation with clear() method.from selenium import webdriver #browser exposes an executable file #Through Selenium test we will invoke the executable file which will then #invoke actual browser ... Read More

1K+ Views
While working on an application and navigating to different pages or different sections of a page, we need to click on various UI elements on a page like a link or a button. All these are performed with the help of click() method.Thus a click() method typically works with elements like buttons and links.Syntax driver.find_element_by_xpath("//button[id ='value']").click()ExampleCoding Implementation with click() method for clicking a link.from selenium import webdriver #browser exposes an executable file #Through Selenium test we will invoke the executable file which will then #invoke #actual browser driver = webdriver.Chrome(executable_path="C:\chromedriver.exe") # to maximize the browser window driver.maximize_window() #get method to launch ... Read More

942 Views
We can enter values in an edit box in Selenium with the help of the methods listed below −Using the send_keys method.This method can send any text to an edit box or perform pressing keys with the help of Keys class.Using the Javascript executor.Javascript Document Object Model can work with any of the elements on the page. Javascript works on the client side and performs actions on the web page. Selenium can execute a Javascript script with the help of execute_script() method. We can enter values on any edit box with the help of this method.ExampleCode Implementation with send_keys method.from ... Read More

860 Views
We can fetch values from a webelement in Selenium with the help of the methods listed below −Using the text method.This will give the inner text of the webelement. It basically gives us the visible text on the screen and its sub element if any. This method will also remove all the forward and backward white spaces.Using the Javascript executor.Javascript Document Object Model can work with any of the elements on the page. Javascript works on the client side and performs actions on the web page. Selenium can execute a Javascript script with the help of execute_script() method. We can ... Read More

8K+ Views
We can click on a link on page with the help of locators available in Selenium. Link text and partial link text are the locators generally used for clicking links. Both these locators work with the text available inside the anchor tags. Link Text: In Selenium a link text is used to hyperlinks on a web page, to create the hyperlinks on a webpage, we can use anchor tag followed by link Text. ... Read More

12K+ Views
We can identify a parent from its children in DOM with the help of xpath. There are situations where we have dynamic attributes for the parent node in html but the child nodes have unique static attributes for identification.This can be achieved with the help of relative xpath along with the parent xpath axe. Method.Syntax driver. find_element_by_xpath("//input[@id='job']/parent::div")ExampleCode Implementation for child to parent traversal.from selenium import webdriver #browser exposes an executable file #Through Selenium test we will invoke the executable file which will then #invoke #actual browser driver = webdriver.Chrome(executable_path="C:\chromedriver.exe") # to maximize the browser window driver.maximize_window() #get method to launch the ... Read More