Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created May 31, 2024 15:09
Show Gist options
  • Save SarahElson/8d3339c0139cc33ccc33828e3458a257 to your computer and use it in GitHub Desktop.
Save SarahElson/8d3339c0139cc33ccc33828e3458a257 to your computer and use it in GitHub Desktop.
What Is Parallel Testing And Why Is It Important?
# Import the required packages
from selenium import webdriver
# Function to retrieve the title of the web page
def get_title():
# Configure Chrome WebDriver options
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
# Initialize Chrome WebDriver
driver = webdriver.Chrome(options=options)
# Open the specified URL
driver.get("https://ecommerce-playground.lambdatest.io/")
# Return the title of the web page
return driver.title
# Function to retrieve the length of the title of the web page
def get_title_length():
# Configure Chrome WebDriver options
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
# Initialize Chrome WebDriver
driver = webdriver.Chrome(options=options)
# Open the specified URL
driver.get("https://ecommerce-playground.lambdatest.io/")
# Return the length of the title of the web page
return len(driver.title)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment