Forum Discussion

ckhim's avatar
ckhim
Occasional Contributor
9 years ago

Run Selenium/JAVA in TestComplete / QAComplete:

Hi SmartBear Community,

 

End goal:
To run Selenium/JAVA within TestComplete / QAComplete.

 

Details:
I have a functional web testing code that checks parameters on the internet explorer web page. The code is written in JAVA programming and Selenium. The IDE is Intellij, where I use to execute, debug, and develop my program. The Intellij also sync up with Maven which also has POM.xml.

I found this video which shows 6 steps to run JAVA/Selenium in TestComplete: http://blog.smartbear.com/how-to/how-to-run-selenium-from-testcomplete-in-6-simple-steps/

The tutorial uses eclipse instead of Intellij, but I don't think it makes any different.

 

Case 1 (use Maven):
Procedure:
1) Create Junit project in TestComplete
2) Under "Use Maven Project" radio button, I put the path to C://****/pom.xml
3) Select "Run all tests"
4) Run

Output:
mvn.cmd test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JPAExample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ JPAExample ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ JPAExample ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ JPAExample ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\MITRE\Functional_Test\DTS_Lync_Code\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ JPAExample ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ JPAExample ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.190 s
[INFO] Finished at: 2016-03-16T14:04:54-04:00
[INFO] Final Memory: 10M/155M
[INFO] ------------------------------------------------------------------------

My issue:
- It does not show any error, but it did not execute any of my test. (Note: my java tests run fine inside Intellij). Do I need to configure pom.xml or TestComplete somehow?

 

Case 2 (Use classpath directory):
Procedure:
1) Create Junit project in TestComplete
2) Under "Specify the classpath directly" radio button, I put the path as C:\Users\ckhim\.m2\repository\junit\junit\4.10\junit-4.10.jar; C:\Users\ckhim\.m2\repository\org\seleniumhq\selenium\selenium-java\2.45.0\selenium-java-2.45.0.jar; C:\MITRE\Functional_Test\DTS_Lync_Code\src\test\java\
3) Select "Run the following test classes", I put org.mitre.test.tests.testFunctionalDTS.checkDTSTitlePage.
4) Run

Output Error:
"C:\Program Files (x86)\Java\jre1.8.0_74\Bin\java.exe" org.junit.runner.JUnitCore org.mitre.test.tests.testFunctionalDTS.checkDTSTitlePage
JUnit version 4.10
Could not find class: org.mitre.test.tests.testFunctionalDTS.checkDTSTitlePage

Time: 0.001

OK (0 tests)

No RepliesBe the first to reply