This file contains 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
#Check if an argument was supplied | |
if [ -z "$1" ] | |
then | |
echo "No argument supplied, please provide video name" | |
else | |
# start recording | |
adb shell screenrecord --bit-rate 6000000 /sdcard/$1.mp4 & | |
# Get its PID | |
PID=$! |
This file contains 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
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 |
This file contains 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 void SettupUpAProxyUsingChromeDriver() | |
{ | |
//Create a chrome options object | |
var chromeOptions = new ChromeOptions(); | |
//Create a new proxy object | |
var proxy = new Proxy(); | |
//Set the http proxy value, host and port. | |
proxy.HttpProxy = "localhost:8888"; | |
//Set the proxy to the Chrome options | |
chromeOptions.Proxy = proxy; |
This file contains 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 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 |
This file contains 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 void SettingUpAProxyUsingFirefoxDriver() | |
{ | |
//Create a new Firefox profile | |
var firefoxProfile = new FirefoxProfile(); | |
//Create a new proxy object | |
var proxy = new Proxy(); | |
//Set the http proxy value, host and port. | |
proxy.HttpProxy = "localhost:8888"; | |
//We then add this proxt setting to the Firefox profile we created | |
firefoxProfile.SetProxyPreferences(proxy); |
This file contains 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
#!/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'" |
This file contains 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
#!/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'" |
This file contains 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 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; |
This file contains 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
BlogObject blogObject = new BlogObject (webDriver, 60); |
This file contains 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
//Inherit the DefaultPage. | |
public class BlogObject : DefaultPage | |
{ | |
//Two parameters, base in your driver, and also the timeout for the page to finish loading. | |
public BlogObject(IWebDriver webDriver, double timeout) | |
: base(webDriver) //Pass the driver to the base class. | |
{ | |
//Initiate the locators dictionary, and assign to private parameter. | |
_locators = Locators(); |
NewerOlder