This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>GetElementByTagNameSelenium</groupId> | |
<artifactId>GetElementByTagNameSelenium</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>GetElementByTagNameSelenium</name> | |
<dependencies> | |
<dependency> | |
<groupId>org.seleniumhq.selenium</groupId> | |
<artifactId>selenium-java</artifactId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.by import By | |
class SmartWait(): | |
def __init__(self, driver): | |
self.driver = driver | |
self.driver.get("https://ecommerce-playground.lambdatest.io/") | |
self.blog_link = driver.find_element(By.LINK_TEXT, "Blog") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.by import By | |
class FluentWait: | |
def __init__(self, driver): | |
self.driver = driver | |
self.driver.get("https://ecommerce-playground.lambdatest.io/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.by import By | |
class ExplicitWait: | |
def __init__(self, driver): | |
self.driver = driver | |
self.driver.get("https://ecommerce-playground.lambdatest.io/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.by import By | |
class ImplicitWait: | |
def __init__(self, driver): | |
self.driver = driver | |
self.driver.get("https://ecommerce-playground.lambdatest.io/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver.common.by import By | |
class SleepWait: | |
def __init__(self, driver): | |
self.driver = driver | |
self.driver.get("https://ecommerce-playground.lambdatest.io/") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import environ | |
import pytest | |
from selenium import webdriver | |
from smartwait_option import option_smartwait | |
@pytest.fixture(scope="function") | |
def driver(request): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the functions for retrieving the title and its length from parallel_testing file | |
from parallel_testing import get_title, get_title_length | |
# Test function to verify the web page title retrieved from browser | |
def test_title(): | |
title = get_title() | |
assert title == "Your Store", "Test not passed for title" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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']) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { setupDriver } = require("./web-driver"); | |
async function performSearch() { | |
const driver = await setupDriver(); | |
try { | |
// Navigate to Google's homepage | |
await driver.get("<https://www.google.com/>"); | |
// Find the search input element and send the search query |