

- 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
Fill username and password using selenium in python.
We can fill username and password fields in a login page with Selenium. This is considered an authentication step for any application. Once the username and password is entered, we have to click the login button.
Example
Code Implementation.
import time from selenium import webdriver driver = webdriver.Chrome (executable_path="C:\chromedriver.exe") driver.get("https://mail.rediff.com/cgi-bin/login.cgi") # identify username, password and signin elements driver.find_element_by_name("login").send_keys("tutorialspoint") time.sleep(0.2) driver.find_element_by_name("passwd").send_keys("pass123") time.sleep(0.4) driver.find_element_by_class_name("signinbtn").click() driver.close
If a valid username and password is provided, we shall be directed to the home page of the application.
Output
- Related Questions & Answers
- C++ program to define exception for small username, and validate username
- Select iframe using Python and Selenium
- Gmail login fail using Selenium webdriver. Showing element not found for password.
- Password validation in Python
- getpass() and getuser() in Python (Password without echo)
- Strong Password Checker in Python
- Running javascript in Selenium using Python.
- Difference Between Flood-fill and Boundary-fill Algorithm
- Validating a password using JavaScript
- Program to fill with color using floodfill operation in Python
- Python Pandas - Fill NaN values using an interpolation method
- How to get the current username and directory in Golang?
- How to save and load cookies using Python Selenium WebDriver?
- Rename Root @ localhost username in MySQL?
- Validating email and password - JavaScript
Advertisements