Skip to content

Instantly share code, notes, and snippets.

@SarahElson
SarahElson / TestHttpStatusCodes.java
Created July 8, 2022 17:37
How to get response status code with Selenium WebDriver Java?
package test;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
@SarahElson
SarahElson / pom.xml
Created July 8, 2022 18:01
How to get response status code with Selenium WebDriver Java?
<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>HttpResponseStatusCodes</groupId>
<artifactId>HttpResponseStatusCodes</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
@SarahElson
SarahElson / BaseClass.java
Created July 8, 2022 18:05
How to get response status code with Selenium WebDriver Java?
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;
@SarahElson
SarahElson / main.py
Last active September 15, 2022 07:55
How To Automate Filling In Web Forms With Python Using Selenium
import random
from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
#lambdatest setup and opening the desired website
username = "Your LambdaTest Username"
accessToken = "Your LambdaTest Access Key"
gridUrl = "hub.lambdatest.com/wd/hub"
@SarahElson
SarahElson / pom.xml
Created July 15, 2022 16:25
Automated App Testing Using Appium With TestNG [Tutorial]
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.lambdatest.appium.sample</groupId>
<artifactId>appium-lambdatest-sample</artifactId>
<version>1.0-SNAPSHOT</version>
@SarahElson
SarahElson / Base test class
Created July 15, 2022 16:29
Automated App Testing Using Appium With TestNG [Tutorial]
package com.lambdatest.appium.sample;
import static java.text.MessageFormat.format;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import com.lambdatest.appium.sample.enums.Environment;
import com.lambdatest.appium.sample.utils.Swipe;
@SarahElson
SarahElson / Base test class.java
Last active June 21, 2023 14:46
Automated App Testing Using Appium With TestNG [Tutorial]
package com.lambdatest.appium.sample;
import static java.text.MessageFormat.format;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import com.lambdatest.appium.sample.enums.Environment;
import com.lambdatest.appium.sample.utils.Swipe;
@SarahElson
SarahElson / Android test.java
Last active June 21, 2023 14:47
Automated App Testing Using Appium With TestNG [Tutorial]
package com.lambdatest.appium.sample.android;
import static com.lambdatest.appium.sample.enums.Platform.ANDROID;
import static org.testng.Assert.assertEquals;
import java.net.MalformedURLException;
import com.lambdatest.appium.sample.BaseTest;
import com.lambdatest.appium.sample.enums.Environment;
import com.lambdatest.appium.sample.enums.Platform;
@SarahElson
SarahElson / iOS test
Created July 15, 2022 16:42
Automated App Testing Using Appium With TestNG [Tutorial]
package com.lambdatest.appium.sample.ios;
import static com.lambdatest.appium.sample.enums.Platform.IOS;
import static org.openqa.selenium.support.ui.ExpectedConditions.elementToBeClickable;
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfElementLocated;
import java.net.MalformedURLException;
import com.lambdatest.appium.sample.BaseTest;
import com.lambdatest.appium.sample.enums.Environment;
@SarahElson
SarahElson / iOS test.java
Last active June 21, 2023 14:47
Automated App Testing Using Appium With TestNG [Tutorial]
package com.lambdatest.appium.sample.ios;
import static com.lambdatest.appium.sample.enums.Platform.IOS;
import static org.openqa.selenium.support.ui.ExpectedConditions.elementToBeClickable;
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfElementLocated;
import java.net.MalformedURLException;
import com.lambdatest.appium.sample.BaseTest;
import com.lambdatest.appium.sample.enums.Environment;