- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 Articles
- 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 uncheck a radio button using JavaScript/jQuery?
- How to select the text of a span on click in Selenium?
- How to click on sign up button using Java in Selenium I am able to open page but not able to click?
- Passing Radio Button Data to CGI Program in Python
- Select iframe using Python and Selenium
- How to click on a link in Selenium with python?
- How to use a click() method in Selenium with python?

Advertisements