Sta Lab
Sta Lab
1. Install the free and open-source Selenium IDE as a Google Chrome extension, and
execute a basic script to automatically launch a web browser.
5. Design test cases for checking the given number is odd or even and execute the same.
Print the status of the test cases along with the number of test cases run.
7. Design test cases for the do while loop implementation and print the status of the test
cases along with the number of test cases run.
8. Install the free and open-source Selenium IDE as a Google Chrome extension. Design
and develop the test cases for compose feature in GMAIL and execute the same.
# Experiment 8: Compose mail in Gmail
driver = webdriver.Chrome()
driver.get("https://mail.google.com")
try:
compose_btn = driver.find_element(By.XPATH, "//div[text()='Compose']")
compose_btn.click()
print("Compose button clicked successfully.")
except:
print("Could not find Compose button.")
time.sleep(3)
driver.quit()
9. Install the free and open-source Selenium IDE as a Google Chrome extension. Design
and develop the test cases for clicking “Delete” button in GMAIL and execute the same.
# Experiment 9: Click 'Delete' in Gmail
driver = webdriver.Chrome()
driver.get("https://mail.google.com")
try:
delete_button = driver.find_element(By.XPATH, "//div[@aria-label='Delete']")
delete_button.click()
print("Delete button clicked.")
except:
print("Delete button not found.")
time.sleep(3)
driver.quit()
10. Install the free and open-source Selenium IDE as a Google Chrome extension.
Design and develop the test cases for performing any two arithmetic operations in
calculator, and execute the same.
# Experiment 10: Perform arithmetic operation on Google calculator
driver = webdriver.Chrome()
driver.get("https://www.google.com/search?q=calculator")
time.sleep(2)
driver.find_element(By.XPATH, f"//div[@aria-label='{num1}']").click()
driver.find_element(By.XPATH, f"//div[@aria-label='{op}']").click()
driver.find_element(By.XPATH, f"//div[@aria-label='{num2}']").click()
driver.find_element(By.XPATH, "//div[@aria-label='equals']").click()
driver = webdriver.Chrome()
driver.get("https://example.com/register") # Replace with real registration page
driver.find_element(By.ID, "username").send_keys(username)
driver.find_element(By.ID, "password").send_keys(password)
driver.find_element(By.ID, "register").click()
12. Install the free and open-source Selenium IDE as a Google Chrome extension.
Design and develop test cases for successful user login checking, and execute the same.
# Experiment 12: User Login form automation
driver = webdriver.Chrome()
driver.get("https://example.com/login") # Replace with actual login page
driver.find_element(By.ID, "username").send_keys(username)
driver.find_element(By.ID, "password").send_keys(password)
driver.find_element(By.ID, "login").click()
13. Install the free and open-source Selenium IDE as a Google Chrome extension.
Design and develop test case for adding a new book, and execute the same.
# Experiment 13: Add a new book (example page)
driver = webdriver.Chrome()
driver.get("https://example.com/addbook") # Replace with actual URL
driver.find_element(By.ID, "title").send_keys(title)
driver.find_element(By.ID, "author").send_keys(author)
driver.find_element(By.ID, "submit").click()
print("Book added successfully.")
time.sleep(3)
driver.quit()
14. Install the free and open-source Selenium IDE as a Google Chrome extension.
Design and develop test case for searching a book, and execute the same.
# Experiment 14: Search a book (example site)
driver = webdriver.Chrome()
driver.get("https://example.com/searchbook") # Replace with actual URL
driver.find_element(By.ID, "search").send_keys(search_query)
driver.find_element(By.ID, "submit").click()
15. Install the free version of the software “Katalon Studio”. Design and develop test
cases for any simple program, and execute the same.