Create Test Cases
Example Prompt:
Example Response:
Related Tasks:
Log Defects
Example Prompt:
Example Response:
Related Tasks:
Execute Test Cases
Example Prompt:
Example Response:
Related Tasks:
Generate Automation Scripts
Example Prompt:
Example Response:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
# Initialize the WebDriver
driver = webdriver.Chrome() # Make sure to have the ChromeDriver installed
try:
# Navigate to the login page
driver.get('http://example.com/login')
# Locate the username and password fields and the login button
username_field = driver.find_element(By.NAME, 'username')
password_field = driver.find_element(By.NAME, 'password')
login_button = driver.find_element(By.XPATH, '//button[@type="submit"]')
# Input valid credentials
username_field.send_keys('valid_username')
password_field.send_keys('valid_password')
# Click the login button
login_button.click()
# Wait for a few seconds to allow the page to load
time.sleep(3)
# Verify successful login by checking the URL or a specific element on the dashboard
assert 'dashboard' in driver.current_url, 'Login failed or redirected to the wrong page'
print('Login test passed!')
except Exception as e:
print(f'An error occurred: {e}')
finally:
# Close the browser
driver.quit()
Related Tasks:
Plan Performance Tests
Example Prompt:
Example Response:
Related Tasks: