

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Using Selenium in Python to click/select a radio button.
We can select/click the radio button with Selenium. In an html document, each radio button has an attribute type set to a value as radio. In order to select a radio button, we shall first identify it and then apply the click() method to it.
Example
Code Implementation.
from selenium import webdriver driver = webdriver.Chrome (executable_path="C:\chromedriver.exe") # maximize with maximize_window() driver.maximize_window() driver.get("https://www.tutorialspoint.com/selenium/selenium_automation_practice.htm") # identify element and click() l=driver.find_element_by_xpath("//input[@value='2']") l.click() driver.close()
Output
- Related Questions & Answers
- How to select a radio button in a page in Selenium with python?
- How to click button Selenium Python?
- Click a href button with Selenium and Python?
- How to find a radio button element by value using Selenium?
- How to select a radio button by default in JavaScript?
- How to click on a button with Javascript executor in Selenium with python?
- How to create a Radio Button using JavaFX?
- How to click on a link using Selenium webdriver in Python.
- How to click a href link using Selenium?
- How to select the text of a span on click in Selenium?
- Passing Radio Button Data to CGI Program in Python
- Bootstrap Form Radio Button
- Select iframe using Python and Selenium
- How to create right click using selenium?
- How to click on sign up button using Java in Selenium I am able to open page but not able to click?
Advertisements