View SimpleChromeTest.java
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 simpleChromeTest() throws MalformedURLException { | |
URL gridUrl = new URL("http://localhost:4444/wd/hub"); | |
RemoteWebDriver webDriver = new RemoteWebDriver(gridUrl, new ChromeOptions()); | |
webDriver.get("http://www.google.com/ncr"); | |
webDriver.findElement(By.name("q")).sendKeys("webdriver", Keys.RETURN); | |
WebDriverWait webDriverWait = new WebDriverWait(webDriver, Duration.ofSeconds(5)); | |
webDriverWait.until(ExpectedConditions.titleContains("webdriver")); |
View Example_1
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
{ | |
capabilities: | |
{ | |
alwaysMatch: | |
{ | |
browserName: 'firefox', | |
platformName: 'macOS 10.13', | |
browserVersion: 'latest' | |
sauce:options: | |
{ |
View Error.java
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
``` | |
org.openqa.selenium.WebDriverException: java.io.EOFException: End of input at line 1 column 1cannot extract a capabilities from the request: | |
Command duration or timeout: 754 milliseconds | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) | |
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) | |
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) | |
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) | |
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) | |
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) |
View docker-compose-issue-425.yml
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
version: '2.2' | |
services: | |
zalenium: | |
image: "dosel/zalenium" | |
container_name: zalenium | |
hostname: zalenium | |
tty: true | |
privileged: true | |
volumes: |
View Custom_Capabiltities.cs
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
FirefoxProfile firefoxHeadlessProfile = new FirefoxProfile | |
{ | |
DeleteAfterUse = true | |
}; | |
firefoxHeadlessProfile.SetPreference("browser.cache.disk.enable", false); | |
firefoxHeadlessProfile.SetPreference("browser.cache.memory.enable", false); | |
firefoxHeadlessProfile.SetPreference("browser.cache.offline.enable", false); | |
firefoxHeadlessProfile.SetPreference("network.http.use-cache", false); | |
FirefoxOptions firefoxHeadlessOptions = new FirefoxOptions | |
{ |
View docker-compose.yaml
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
# docker-compose file | |
# To execute this docker-compose yml file use docker-compose -f <file_name> up | |
# Add the "-d" flag at the end for deattached execution | |
#selenium-hub: equivalent to manually running the command docker run -d -p 4444:4444 --name selenium-hub -P selenium/hub:3.6.0-bromine | |
selenium-hub: | |
restart: always | |
image: selenium/hub:3.6.0-bromine | |
ports: | |
- "4444:4444" |
View chromedriver-install.sh
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
#!/bin/bash | |
# download and install latest chromedriver for linux or mac. | |
# required for selenium to drive a Chrome browser. | |
install_dir="/usr/local/bin" | |
version=$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE) | |
if [[ $(uname) == "Darwin" ]]; then | |
url=https://chromedriver.storage.googleapis.com/$version/chromedriver_mac64.zip | |
elif [[ $(uname) == "Linux" ]]; then | |
url=https://chromedriver.storage.googleapis.com/$version/chromedriver_linux64.zip |
View startHub
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
java -jar selenium-server-standalone-3.6.0.jar -role hub |
View start-docker-selenium.sh
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
#!/bin/bash | |
#docker stop $(docker ps -a --quiet) && docker rm $(docker ps -a --quiet) | |
for i in {0..10}; do | |
echo item: $i | |
hostIp=10.161.128.80 | |
echo hostIp: $hostIp | |
nodePort=$((40000 + i)) | |
echo nodePort: $nodePort | |
noVncPort=$((50000 + i)) | |
echo noVncPort: $noVncPort |
NewerOlder