Execute Selenium tests with Selenic and API tests with SOAtest at the same time

Chris ColosimoChris Colosimo Posts: 98 admin
edited February 12 in Selenic

Selenium tests execute from the command line or the IDE. SOAtest tests also execute from the command line or from SOAtest. So you could execute them both from the commandline together. There are many ways to do this, like from Jenkins. Here is an example script:

AGENT_DIR=<PATH TO SELENIC JARS>
WEBDRIVER_DIR=<PATH TO WEBDRIVER>

SELENIUM_WORKSPACE=<PATH TO SELENIUM WORKSPACE>
SELENIUM_PROJECT=<PATH TO SELENIUM PROJECT> //com.parasoft.webdriver.parabank.junit
SELENIUM_TEST=<PATH TO SELENIUM TEST> //ParabankDemoTest

SOATEST_HOME=<PATH TO SOATEST>
SOATEST_WORKSPACE=<PATH TO SOATEST WORKSPACE>
SOATEST_TEST=<PATH TO SOATEST TEST> //mytest.tst

REPORT=<PATH TO REPORTS>

//First Execute Selenium Tests
cd $SELENIUM_WORKSPACE
mvn surefire:test \
-pl $SELENIUM_PROJECT \ 
-Dtest=$SELENIUM_TEST \
-DfailIfNoTests=false \
-Dwebdriver.chrome.driver=$WEBDRIVER_DIR/chromedriver_win32/chromedriver.exe \
-DargLine=-javaagent:$AGENT_DIR/selenic_agent.jar=captureDOM=true,screenshot=failures,selfHealing=true,createAPITests=false
java -jar $AGENT_DIR/selenic_analyzer.jar -report $REPORT/report.html -publish

/Then Execute SOAtest
cd "$SOATEST_HOME"
./soatestcli.exe -data "$SOATEST_WORKSPACE " -config "user://Example Configuration" -resource $SOATEST_TEST -report $REPORT
Sign In or Register to comment.