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 pytest | |
from selenium import webdriver | |
import sys | |
from selenium.webdriver.common.by import By | |
from selenium.common.exceptions import NoSuchElementException | |
# Desired Capabilities according to SELENIUM 4 | |
ch_capabilities = { | |
'LT:Options' : { |
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 pytest | |
from selenium import webdriver | |
import sys | |
from selenium.webdriver.common.by import By | |
from selenium.common.exceptions import NoSuchElementException | |
# Desired Capabilities according to SELENIUM 4 | |
ff_capabilities = { | |
'LT:Options' : { | |
"user" : "<username>", |
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 pytest | |
from selenium import webdriver | |
import sys | |
from selenium.webdriver.common.by import By | |
from selenium.common.exceptions import StaleElementReferenceException |
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
ch_capabilities = { | |
'LT:Options': { | |
"user": "<username>", | |
"accessKey": "<accesskey>", | |
"build": "StaleElementReferenceException Test on Chrome", | |
"name": "StaleElementReferenceException Test on Chrome", | |
"platformName": "Windows 10" | |
}, | |
"browserName": "Chrome", | |
"browserVersion": "102.0", |
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
def test_ecommerceplayground_staleelement(): | |
# LambdaTest Profile username | |
user_name = "<username>" | |
# LambdaTest Profile access_key | |
app_key = "<accesskey>" | |
# Remote Url to connect to our instance of LambdaTest | |
remote_url = "https://" + user_name + ":" + \ | |
app_key + "@hub.lambdatest.com/wd/hub" | |
# creating an instance of Chrome based on the remote url and the desired capabilities | |
ch_driver = webdriver.Remote( |
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 pytest | |
from selenium import webdriver | |
import sys | |
from selenium.webdriver.common.by import By | |
from selenium.common.exceptions import StaleElementReferenceException | |
ch_capabilities = { | |
'LT:Options' : { | |
"user" : "<username>", | |
"accessKey" : "<accesskey>", |
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
require 'selenium-webdriver' | |
require 'test-unit' | |
class BrowserWindowTests < Test::Unit::TestCase | |
def setup | |
username = "#{ENV['LAMBDATEST_USERNAME']}" | |
access_token = "#{ENV['LAMBDATEST_ACCESS_KEY']}" | |
grid_url = "hub.lambdatest.com/wd/hub" | |
capabilities = { |
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
#Implementation of Selenium WebDriver with Python using PyTest | |
import pytest | |
from selenium import webdriver | |
import sys | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.common.keys import Keys | |
from time import sleep | |
saf_capabilities = { | |
"build" : "Porting test to LambdaTest Selenium Grid (Safari)", | |
"name" : "Porting test to LambdaTest Selenium Grid (Safari)", |
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
public class BaseTest { | |
protected DriverManager driverManager; | |
@Parameters ("deviceId") | |
@BeforeClass (alwaysRun = true) | |
public void setupTest (final String deviceId) { | |
this.driverManager = DriverManager.builder () | |
.deviceId (deviceId) | |
.build () |
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
<dependencies> | |
<!-- https://mvnrepository.com/artifact/org.testng/testng --> | |
<dependency> | |
<groupId>org.testng</groupId> | |
<artifactId>testng</artifactId> | |
<version>${testng-version}</version> | |
<scope>test</scope> | |
</dependency> | |
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --> | |
<dependency> |