Access/Run Selenic Tests From SOATest
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.
Comments
-
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.
0 -
Thanks! I will look at both methods and determine which works best for us.
0 -
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.
0 -
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.0 -
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!0 -
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.
0 -
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!0 -
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?
0 -
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"0 -
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.
0 -
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?
1 -
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.
1 -
I have switched to the JUnit executor and have successfully run the Selenium tests from SOATest. Thanks everyone for your assistance!
0