Skip to content

yvivanov/rest-selenium-grid-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

*REST*
[set | export] AURL=<authentication_url>
[set | export] USER=<e-mail>
[set | export] PSWD=<password>

*Selenium* tests were implemented on a remote Grid hub
to to allow, for example, Internet Explorer web-driver
on Linux platform with Jenkins Windows slave Grid node
See   https://github.com/yvivanov/selenium-grid-testng
                   http://www.seleniumhq.org/download/

# Start Grid hub in CLI window
java -jar selenium-server-standalone-3.3.1.jar -role hub -port 8844 -browserTimeout 69 -timeout 96

# Start Grid node in separate CLI window
java -Dwebdriver.chrome.driver=chromedriver.exe -Dwebdriver.ie.driver=IEDriverServer.exe   -jar selenium-server-standalone-3.1.0.jar -role node -hub http://localhost:8844
java -Dwebdriver.chrome.driver=chromedriver     -Dwebdriver.geckodriver.driver=geckodriver -jar selenium-server-standalone-3.3.1.jar -role node -hub http://localhost:8844
java -jar selenium-server-standalone-3.3.1.jar -role node -hub -nodeConfig config_node.json

[set | export] SURL=<selemium_test_url>
[set | export] HURL=<selemium_grid_hub_url>

cd <project_folder>
gradlew clean jar
set CLASSPATH=.\build\libs\rest-selenium-grid-tests-17.04.10.jar
java org.testng.TestNG PROD.xml
...
===============================================
SUITE
Total tests run: 9, Failures: 0, Skips: 0
===============================================

*Jenkins Build*
Source Code Management
    (*) Git
Build
    (*) Invoke Gradle
    clean
    jar

*Test Run*
Build/Execute shell
#!/bin/bash

export PROJ_HOME=${JENKINS_HOME}/workspace/...
export CLASSPATH=$PROJ_HOME-build/build/libs/rest-selenium-grid-tests-17.04.10.jar
export TEST_CONF=$PROJ_HOME-build/PROD.xml

export AURL=https://...com/authentication
export HURL=http://192.168.0.189:8844/wd/hub
export SURL=https://...com/epicenter
export USER=xxxxxx
export PSWD=******

cat  $TEST_CONF
java org.testng.TestNG $TEST_CONF

*Start Report Server*
    http://192.168.0.222:8855/index.html
    http://192.168.0.222:8855/SUITE/TEST.html
Build/Execute shell
#!/bin/bash

cat   <<EOF >config.yml
HOST: 192.168.0.222:8855
PORT: 8855
ROOT: /var/lib/jenkins/workspace/...-test-run/test-output
EOF
cat   config.yml

export PROJ_HOME=${JENKINS_HOME}/workspace/...
export CLASSPATH=$PROJ_HOME-build/build/libs/rest-selenium-grid-tests-17.04.10.jar
cp    $PROJ_HOME-build/favicon.ico $PROJ_HOME-test-run/test-output/.
echo  $CLASSPATH
java  com.ajourdesign.application.Mini

*Stop Report Server*
    http://192.168.0.222:8855/HALT
Build/Execute shell
#!/bin/bash

ps        -aux | grep Mini | grep jenkins | grep -v grep
echo $(ps -aux | grep Mini | grep jenkins | grep -v grep | cut -c10-14)
kill $(ps -aux | grep Mini | grep jenkins | grep -v grep | cut -c10-14)