Skip to content

Instantly share code, notes, and snippets.

Richard Bradshaw FriendlyTester

View GitHub Profile
@FriendlyTester
FriendlyTester / MinimizeWebDriver.java
Created Apr 25, 2020
Selenium Minimize Browser Window
View MinimizeWebDriver.java
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.time.Duration;
public class MinimizeWebDriver
@FriendlyTester
FriendlyTester / AndroidRecord.sh
Created Aug 21, 2018
Record Android with ADB and Download the File
View AndroidRecord.sh
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
function usage(){
echo -e "\nThis script will record what is happening on an Android device"
echo -e " "
echo -e "Usage: './`basename $0` foo' or './`basename $0` foo.mp4'"
echo -e "Both of the above will produce a recording with the filename 'foo.mp4'"
@FriendlyTester
FriendlyTester / AndroidScreenshot.sh
Created Aug 21, 2018
ADB Take Screenshot and Pull It
View AndroidScreenshot.sh
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
function usage(){
echo -e "\nThis script will screenshot what is happening on an Android device"
echo -e " "
echo -e "Usage: './`basename $0` foo' or './`basename $0` foo.mp4'"
echo -e "Both of the above will produce a recording with the filename 'foo.mp4'"
@FriendlyTester
FriendlyTester / .java
Created Apr 30, 2017
Running Chrome Headlessly Using WebDriver
View .java
import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.safari.SafariDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
@FriendlyTester
FriendlyTester / LogSounds.sh
Last active Feb 5, 2016
Shell Script To Play Sounds On Word Match
View LogSounds.sh
tail -n 0 -f log.txt | grep --line-buffered 'ERROR' | while read line; do afplay beep-01a.wav; done
#log.txt this is the log file you want to tail. Full path if not in that directory
#'ERROR' is the stirng you are looking to match
#beep-01a.wav is the sound to play when string matched. Full path if not in that directory
#Maik later responded saying his logfile was on a remote server, he discovered the following worked to tail a remote file
ssh <user@remoteserver> tail -n 0 -f log.txt | grep --line-buffered 'ERROR' | while read line; do afplay beep-01a.wav; done
View ANdrewGist.java
public class UserBuilder
{
private User;
public UserBuilder()
{
User = new User();
user.setFirstName("Richard");
user.setSurname("Bradshaw");
user.setAge(29);
View DPBFinal.java
public UserChecks
{
public void DataCreation()
{
User user = UserBuilder().buildGenericUser();
user.setSurname("Richards");
user.setAge(35);
UserCreator.create(user);
}
}
@FriendlyTester
FriendlyTester / OPBManipulation.java
Last active Aug 29, 2015
Manipulations the output form the builder
View OPBManipulation.java
public UserChecks
{
public void DataCreation()
{
User user = UserBuilder().buildGenericUser();
user.setSurname("Richards");
user.setAge(35);
}
}
View DBPPersonaBuilder.java
public class UserBuilder
{
public User buildGenericUser()
{
User user = new User();
user.setFirstName("Richard");
user.setSurname("Bradshaw");
user.setAge(29);
user.setEmailAddress("richard@richard.com");
return user;
View DBPGenericBuilder.java
public class UserBuilder
{
public User buildGenericUser()
{
User user = new User();
user.setFirstName("Richard");
user.setSurname("Bradshaw");
user.setAge(29);
user.setEmailAddress("richard@richard.com");
return user;
You can’t perform that action at this time.