Skip to content

Instantly share code, notes, and snippets.

View ShamaUgale's full-sized avatar

Shama Ugale ShamaUgale

View GitHub Profile
@ShamaUgale
ShamaUgale / pom.xml
Created September 17, 2020 22:59
This is a sample pom.xml file for selenium 4
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>selenium4</groupId>
<artifactId>selenium4</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
@ShamaUgale
ShamaUgale / build.gradle
Created September 22, 2020 11:01
A sample build.gradle for downloading selenium 4 dependencies with gradle
plugins {
id 'java'
}
group 'SeleniumGradleSample'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
@ShamaUgale
ShamaUgale / googleSearchTest.js
Created September 22, 2020 12:33
A sample js script for selenium 4 with Selenium JS binding
const {Builder,Buy,Key} = require("selenum-webdriver");
async function searchTest(){
// create and open a firefox driver object
let driver = await new Builder.forBrowser("firefox").build();
// navigate to google.com
await driver.get("https://www.google.com");
// locate the google search textbox and enter "Selenium 4", hit Enter key
@ShamaUgale
ShamaUgale / package.json
Last active September 22, 2020 13:18
A sample package.json file with selenium 4 dependencies and running the first test named "firstTest.js"
{
"name": "google-sample-test",
"version": "1.0.0",
"description": "a sample selenium 4 with js ",
"main": "googleSearchTest.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Shama Ugale",
"license": "ISC",
@ShamaUgale
ShamaUgale / FullScreenModeExecution.java
Created September 24, 2020 21:19
A sample code to demonstarte Full Screen Mode Execution
public class FullScreenExamples {
final static String PROJECT_PATH = System.getProperty("user.dir");
public static void main(String[] args) throws IOException {
WebDriver driver = null;
System.setProperty("webdriver.chrome.driver", PROJECT_PATH+ "/src/main/resources/chromedriver");
driver = new ChromeDriver();
driver.manage().window().fullscreen();
@ShamaUgale
ShamaUgale / AddOns.java
Last active September 25, 2020 16:36
A sample to demonstarting installing and unstalling an addon in firefox browser using #Selenium4
import org.openqa.selenium.firefox.FirefoxDriver;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Addon {
final static String PROJECT_PATH = System.getProperty("user.dir");
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import static org.openqa.selenium.support.locators.RelativeLocator.withTagName;
public class RelativeLocatorsExample {
final static String PROJECT_PATH = System.getProperty("user.dir");
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", PROJECT_PATH+ "/src/main/resources/chromedriver");
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import static org.openqa.selenium.support.locators.RelativeLocator.withTagName;
public class ApplitoolsBlogsEx {
final static String PROJECT_PATH = System.getProperty("user.dir");
@ShamaUgale
ShamaUgale / pom.xml
Last active October 21, 2020 19:40
Maven dependencies for Karate
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.karate.sample</groupId>
<artifactId>karate-example</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
@ShamaUgale
ShamaUgale / build.gradle
Last active October 21, 2020 19:41
gradle dependencies for Karate
plugins {
id 'java'
}
ext {
karateVersion = '0.9.6'
}
dependencies {
testCompile "com.intuit.karate:karate-junit5:${karateVersion}"