Access/Run Selenic Tests From SOATest

Speedy993Speedy993 Posts: 35

I have a number of tests created use the Parasoft Recorder and would like to use SOATest to setup and tear down these tests. What I would like to do is create test records via the DB Tool in SOATest, run the Selenic test(s) passing in some parameters (environment, test data key values, etc), check the results of the test(s), then clean up the data via SOATest. I have been scouring the Parasoft website and forum as well as general Googling but have not been able to find anything. Can someone point me to where I can find more information on if this can be done and how to do it? Would this be done with commands (Ant script) to call the tools?
Thanks for any help you can offer.

Tagged:

Comments

  • benken_parasoftbenken_parasoft Posts: 1,009 ✭✭✭

    Since you are using Selenic, and presumably java-based Selenium test, I recommend you adding setup/teardowns directly to your Selenium test. You can use JDBC to do whatever database updates you need to do.

    Otherwise, you can also drive your Selenium tests directly from SOAtest using the JUnit or TestNG executor tools from the "External Executors Pack" from https://marketplace.parasoft.com/ . In other words, you can have a SOAtest test suite that runs both your DB Tools and Selenium tests.

  • Speedy993Speedy993 Posts: 35

    Thanks! I will look at both methods and determine which works best for us.

  • jakubiakjakubiak Posts: 738 admin

    The downside of the second method suggested by @benken_parasoft is that it will not run the Selenium tests with Selenic. So the first method is preferable if you are using Selenic while executing your Selenium tests.

  • Speedy993Speedy993 Posts: 35

    I am looking to try both methods (drive Selenium tests from SOATest and run them standalone.
    I have installed the External Executors Pack and tried to call the tests but I am getting an error when executing the Selenium tests stating:
    Message: testSILS_Devl_AddDeleteSubject(com.Hennepin.AddDeleteSubject_Test): java.lang.NoSuchMethodError:
    I get the same error whether I specify a method or not. Is this looking for a particular method from the class? Selenic generated all of the methods based on the navigation I made through the java web app.

  • Speedy993Speedy993 Posts: 35

    Perhaps I should offer a little more detail here. I have a Java we app that allows the user to search for people in a SQL Server database. They can search on a number of different criteria including the name. A list of names meeting the search parameters are displayed and the user can select one to get the detail information about that person. From here the user can update or delete the person and in this test I want to delete the person and then do another search to ensure the person is not found.
    After importing the resulting Json file that the Parasoft Recorder created into IBM's Rational Application Developer IDE, a number of components were created. Among them is the main Java file that calls methods defined in other Java files that reflect the web app pages navigated through while recording the actions to search and delete a person in the app. Following the instructions included with the Selenium Executor Tool, I have installed and configured the tool in SOATest. When specifying the settings for the test in SOATEst, I indicate the JAR file (created by exporting from RAD), the class and the method that runs the test. I am not sure if I have set something incorrectly. When I try to run the test, I am getting the error that the method is not present in the class. The test runs without problems in RAD but not when trying to run the test JAR file via SOATest.
    Without writing a 5000 word description here, is this enough information for someone to understand what I am doing wrong? I can provide more detail if wanted/needed.
    Thanks!

  • jakubiakjakubiak Posts: 738 admin

    The additional detail helped. The method field should only have the method name, and not include the package name or class name of the test.

  • Speedy993Speedy993 Posts: 35

    After removing the class name so that the method is defined as testSim_Devl_AddDeleteSubject I am now getting an error stating that 'Message: testSim_Devl_AddDeleteSubject(com.Department.AddDeleteSubject_Test): java.lang.NoSuchMethodError: ' The method is part of (com.Department.AddDeleteSubject_Test along with two other methods afterTest() and beforeTest() to create and quit the ChromeDriver and arguments.
    Thanks!

  • jakubiakjakubiak Posts: 738 admin

    Can you double-click on the error that is reported by SOAtest to bring up the error details, and then either take a screenshot of the details or copy/paste the entire text of the details here?

  • Speedy993Speedy993 Posts: 35

    Thanks for your help. Here are more details for the test I am working on.
    This is the full text of the error I am getting in SOATest when trying to run the Selenium Executor test shown in one of the attached images.
    "Message: testSILS_Devl_AddDeleteSubject(com.Hennepin.AddDeleteSubject_Test): java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeOptions.addArguments([Ljava/lang/String;)Lorg/openqa/selenium/chrome/ChromeOptions;
    Location: C:\SVN\is0993_HJIP_SILS_Intgr\HJIP_SILS_Intgr\HJIPSILSTest\soatest\UpdateNotifications.tst
    Path: /HJIPSILSTest/soatest/UpdateNotifications.tst
    Line: -1 Severity: 1"

  • benken_parasoftbenken_parasoft Posts: 1,009 ✭✭✭
    edited February 25

    java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeOptions.addArguments([Ljava/lang/String;)Lorg/openqa/selenium/chrome/ChromeOptions;

    This looks like your Selenium test classes are trying to be loaded with a different version of Selenium than what was used to compile the code. What jars did you add in the SOAtest preferences? It looks like you either did not add the Selenium jars or added different conflicting versions of the Selenium jars.

    Concerning the "External Executors Pack", please make sure you only added the jar for the JUnit or TestNG executor (depending whether your tests are using JUnit or TestNG) and nothing else to avoid possible conflicts. Your test project and Selenium dependencies should have been added using the "Add Java Project" button.

  • jakubiakjakubiak Posts: 738 admin

    I see that @Speedy993 is using the Selenium Executor and not the JUnit or TestNG Executor - are you suggesting that they should instead use the JUnit or TestNG Executor and add the necessary Selenium dependencies in the SOAtest System Properties preferences?

  • benken_parasoftbenken_parasoft Posts: 1,009 ✭✭✭
    edited March 6

    I can't recommend using the Selenium Executor. It was written to depend on a very specific version of Selenium, a very outdated one. I always tell users to use the plain JUnit or TestNG executors so they can add the specific version of the Selenium jars expected by their tests.

  • Speedy993Speedy993 Posts: 35

    I have switched to the JUnit executor and have successfully run the Selenium tests from SOATest. Thanks everyone for your assistance!

Sign In or Register to comment.