Forum Discussion

nedbacan's avatar
Frequent Contributor
2 years ago

Can I reuse my JavaScript created in TestComplete in another test environment (i.e. Selenium/Robot)

Can I reuse or convert my JavaScript created in TESTComplete into Selenium environment or Robot framework? 


I know I can run a Selenium code inside TestComplete but how about the vice-versa? 


Are the identified elements, object names the same for both ?


Thank you.


1 Reply

  • AlexKaras's avatar
    Champion Level 3



    No, it is not possible to run TestComplete code inside Selenium not run Selenium code inside TestComplete.

    Selenium is just a library that requires external application for its execution. Traditionally, unit-test driver applications (xUnit, MSTest, etc.) are used to execute code that uses functionality provided by Selenium library. In theory, TestComplete can be used as a driver application for Selenium code created using JavaScript or Python, but I am not aware about such attempts and, most probably, one will have to create an intermediate level of code to keep compatibility of Selenium code with traditional unit-test drivers.

    What TestComplete does to execute Selenium code, is it just starts corresponding unit-test driver and passes it the assembly with Selenium code to be executed.


    TestComplete, as opposed to Selenium, is not a library, but test environment, that provides not only the functionality to drive tested application, but also an infrastructure like log (Selenium, as a library, does not provide even test log!), execution engine, supplementary objects like checkpoints, built-in POM-like support (known as Aliases), etc. Those objects are supported by TestComplete runtime engine only and thus TestComplete code cannot be used outside of its runtime engine.

    Likewise, you can execute TestComplete tests from within Selenium-based code by launching TestComplete/TestExecute process and passing it relevant parameters to specify test(s) to be executed. But I think that this not that type of TestComplete code execution in Selenium environment that you are talking about.