How to run Selenium from TestComplete in 6 Simple Steps

We all love Selenium, but let’s face it: it can only test browser applications. So what happens if you work for a company that requires you to automate a bunch of different technologies?

Wouldn’t it be cool to be able to run all your Selenium, Unit and non-browser automation scripts from the same IDE and have all the results in just one test report? Well, with SmartBear’s TestComplete 10.5 you can now do just that!

SmartBear is one of the few test tool vendors that actually embrace open source technologies like Selenium. Heck — one of my favorite API testing tools is their own open source testing tool –SoapUI.

To get a sense for Test Complete’s open-source automation goodness, I’m going to share with you just how easy it is to run a Selenium test from within TestComplete in just six simple steps.

1. Identify the Selenium test you want to run

Identify the Selenium tests that you want to run in TestComplete. For my example I’ll be using Java and JUnit. In my project I can identify my test by looking for the jUnit @Test annotation.

Selenium_TestComplete1

2. Create a new Project

In TestComplete, create a new project (or you can add to an existing project.)

Selenium_TestComplete2

3. Add a Selenium collection to your project

Right click on the new project and Add>New Item.

Selenium_TestComplete3

Under Create Project Item, choose the Selenium or Unit Testing option.

Selenium_TestComplete4

4. Select which Selenium Framework you are using

Right click on the new Selenium project and select Add>New Item.

Selenium_TestComplete5

Under Create Project Item, select the framework that your Selenium tests are using:

Selenium_TestComplete6

TestComplete supports the following frameworks:

  • JUnit Test
  • TestNG test
  • PyUnit Test
  • NUnit Test
  • PHPUnit Tests
  • Ruby Tests

5. Configure your project

Based on the framework you selected, your options will differ. These are the settings that need to be set for a jUnit framework test.

Selenium_TestComplete7

In this case I’m using Java with Maven, so I’m going to select Use Maven project and point to the pom.xml file location for the Selenium tests I want to run:

Selenium_TestComplete8

I want to run all tests, so I’ll select the Run all tests option.

6. Run your test

Right click on your project and select the Run yourProjectName [JUnit] option.

Selenium_TestComplete9

Once the tests finish, right click on your Log Items and select View Results in IE.

Selenium_TestComplete10

To view the actual Maven output that you would normally see in your IDE’s console output, click on the Additional Info tab:

Selenium_TestComplete11

Recap

Now it’s all up to you to unleash your imagination on the types of test automation you can accomplish — all from within a central IDE — to create your own test automation awesomeness.

 

 

Comments

  1. Minh Nguyen says:

    When I ran my test, I got this error:
    Failed to build the Maven project ‘C:\ToolsQA\OnlineStore\pom.xml’.

    Additional Info

    mvn.bat test-compile
    The system cannot find the file specified

    • Dear Minh Nguyen,

      Did you find solution for this error?

      “Additional Info

      mvn.bat test-compile
      The system cannot find the file specified”

  2. Hi,

    To check if this issue is TC-specific or not, please open the command prompt, switch to the folder where the pom.xml file is located, and run this command:
    mvn.bat test-compile

    If you see the same error, then it looks like the path to mvn.bat is not in your PATH environment variable. You can find the Maven configuration instructions here:
    https://maven.apache.org/download.cgi

    Let me know how it goes!

    • Hi Alex,

      Thank you for answer. It was problem with maven, because new version of maven 3.3.1 has mvn.cmd not mvn.bat. I installed 3.2.5 version and now is better but I have another problem. Mayby you help me.

      Error : Failed to build the Maven project ‘C:\Users\Daniel\pl\pom.xml’. 19:54:07 Normal

      Additional Info:

      mvn.bat test-compile
      [INFO] Scanning for projects…
      [INFO]
      [INFO] ————————————————————————
      [INFO] Building pl 1.0-SNAPSHOT
      [INFO] ————————————————————————
      [INFO]
      [INFO] — maven-resources-plugin:2.7:copy-resources (copy-resources) @ pl —
      [INFO] Using ‘UTF-8’ encoding to copy filtered resources.
      [INFO] skip non existing resourceDirectory C:\Users\Daniel\pl\src\non-packaged-resources
      [INFO]
      [INFO] — maven-resources-plugin:2.7:resources (default-resources) @ pl —
      [INFO] Using ‘UTF-8’ encoding to copy filtered resources.
      [INFO] skip non existing resourceDirectory C:\Users\Daniel\pl\src\main\resources
      [INFO]
      [INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ pl —
      [INFO] Nothing to compile – all classes are up to date
      [INFO]
      [INFO] — maven-resources-plugin:2.7:testResources (default-testResources) @ pl —
      [INFO] Using ‘UTF-8’ encoding to copy filtered resources.
      [INFO] skip non existing resourceDirectory C:\Users\Daniel\pl\src\test\resources
      [INFO]
      [INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ pl —
      [INFO] Nothing to compile – all classes are up to date
      [INFO] ————————————————————————
      [INFO] BUILD SUCCESS
      [INFO] ————————————————————————
      [INFO] Total time: 1.363 s
      [INFO] Finished at: 2015-04-01T19:54:07+02:00
      [INFO] Final Memory: 9M/153M
      [INFO] ————————————————————————
      ‘cmd’ is not recognized as an internal or external command,
      operable program or batch file.

Speak Your Mind

*