Automated Testing Lab Manual
Automated Testing Lab Manual
2. Environment Setup
Objective:
Key Concepts:
• Benefits:
2. Environment Setup
Objective:
Tools Required:
Step-by-Step Instructions:
2. Install an IDE:
4. Download ChromeDriver:
5. Verify Installation:
o Open your IDE and write the following script to check Selenium:
driver = webdriver.Chrome()
driver.get("https://www.google.com")
driver.quit()
Objective:
o Open your IDE and create a new Python file (e.g., login_test.py).
# Setup WebDriver
driver = webdriver.Chrome()
driver.get("https://example.com/login")
# Perform login
driver.find_element(By.ID, "username").send_keys("test_user")
driver.find_element(By.ID, "password").send_keys("password123")
driver.find_element(By.ID, "loginButton").click()
driver.quit()
2. Exercise:
Objective:
Step-by-Step Instructions:
python login_test.py
2. Analyze Results:
3. Exercise:
Objective:
Step-by-Step Instructions:
username,password
test_user1,password1
test_user2,password2
driver = webdriver.Chrome()
reader = csv.DictReader(file)
driver.get("https://example.com/login")
driver.find_element(By.ID, "username").send_keys(row['username'])
driver.find_element(By.ID, "password").send_keys(row['password'])
driver.find_element(By.ID, "loginButton").click()
driver.quit()
2. Handling Exceptions:
try:
driver.find_element(By.ID, "loginButton").click()
except Exception as e:
print(f"Error: {e}")
3. Exercise: