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
using NUnit.Framework; | |
using OpenQA.Selenium; | |
using OpenQA.Selenium.Chrome; | |
namespace SeleniumTutorial | |
{ | |
public class SeleniumTests | |
{ | |
private IWebDriver driver; | |
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>MultipleCheckboxes</groupId> | |
<artifactId>MultipleCheckboxes</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<build> | |
<sourceDirectory>src</sourceDirectory> | |
<plugins> | |
<plugin> | |
<artifactId>maven-compiler-plugin</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
package test; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import org.openqa.Selenium.remote.DesiredCapabilities; | |
import org.openqa.Selenium.remote.RemoteWebDriver; | |
import org.testng.annotations.AfterMethod; | |
import org.testng.annotations.BeforeMethod; |
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
package test; | |
import java.util.List; | |
import org.openqa.Selenium.By; | |
import org.openqa.Selenium.WebElement; | |
import org.testng.annotations.Test; | |
public class TestCheckboxes extends BaseClass{ |
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
//imports... | |
public class LambdaTest { | |
private String testName; | |
public static final String demoPage = "https://demo.evinced.com/"; | |
private RemoteWebDriver webDriver; | |
private String Status = "failed"; | |
@BeforeMethod | |
public void setup(Method m, ITestContext ctx) throws MalformedURLException { |
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
private EvincedWebDriver driver; | |
@BeforeMethod | |
public void setup(Method m, ITestContext ctx) throws MalformedURLException { | |
String username = System.getenv("LT_USERNAME"); | |
String authkey = System.getenv("LT_ACCESS_KEY"); | |
String hub = "@hub.lambdatest.com/wd/hub"; | |
DesiredCapabilities caps = new DesiredCapabilities(); |
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
@AfterMethod | |
public void tearDown() { | |
// Stop the Evinced engine and generate the report object | |
Report report = driver.evStop(); | |
// Export the report - JSON | |
EvincedReporter.writeEvResultsToFile("Evinced-LambdaTest-A11y-JSONReport", report, EvincedReporter.FileFormat.JSON); | |
// Export the report - HTML | |
EvincedReporter.writeEvResultsToFile("Evinced-LambdaTest-A11y-HTMLReport", report, EvincedReporter.FileFormat.HTML); | |
driver.quit(); | |
} |
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
[[source]] | |
name = "pypi" | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
[packages] | |
pytest = "*" | |
selenium = "*" | |
[requires] | |
python_version = "*" |
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 | |
from selenium.webdriver.common.keys import Keys | |
class EcommercePlaygroundPage: | |
#url | |
url = 'https://ecommerce-playground.lambdatest.io/' | |
#locators | |
search_form = (By.NAME, "search") | |
search_button = (By.CSS_SELECTOR, ".type-text") | |
# Initializer | |
def __init__(self, browser): |
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 pages.ecommerce_playground import EcommercePlaygroundPage | |
keyword = "iPhone" | |
def test_ecommerce_playground(browser): | |
ecommerce_page = EcommercePlaygroundPage(browser) | |
ecommerce_page.load() | |
ecommerce_page.search(keyword) | |
get_url = browser.current_url | |
title = browser.title | |
print("The current url is: "+str(get_url)) |