Is it possible to run a specific test suite on one of the endpoints?


#1

Is it possible to run a specific test suite on one of the endpoints?
Here the need is to run some tests( which are grouped into one test suite) on a specific endpoint( which runs on the browser but in a different language) .
We are trying to do this from the command line. Any suggestions here are welcome

Also, when i try to run all suites which start with letter p for example, i am using the below command line and facing issues.
“%LOCALAPPDATA%\Programs\webtestit\Ranorex Webtestit.exe” run “Projectfolder” [options] --test-file-patterns=“Projectfolder\test\tests\p*.ts”
Am i missing anything here?


#2

In order to fully understand your requirements it would be fantastic if you could create a minimalistic demo sample and share that with us, explicitly stating which files you’d like to get executed.
With these things it’s always hard to help with an appropriate answer without having the project at hand to judge where the issue might appear from. You can either put the sample on Github or just zip it up end send it to us at [email protected]

One thing that immediately jumps into my attention is your test-file-patterns value which is using the windows style backslashes. In your case the \test as an example might be interpreted as TAB-ESCAPE-SEQUENCE-est. So perhaps you could try to express them with unix style forward slashes instead.


#3

Hello,
I have a similar question on how to run specific tests (or a folder of tests) from Jenkins. If I have the following project structure in C:\Users\automation\Documents\fwregression:

fwregression

  • reports
  • resources
  • src
    • test
      • java
        • uitest
          • data
          • pageobjects
          • tests
            • Users
              • RA1_AddUser.java
              • RA2_DeleteUser.java
              • RA3_VerifyUser.java
            • Roles
            • Investigations
              • RA4_Alerts.java
              • RA5_Security.java
              • RA6_Compliance.java

What would be the command in CLI mode if you want to only run test RA1_AddUser in the Users folder?
What if you want to only run all 3 tests in the Users folder?
What if you want to run all tests in the Users and Investigations folders?

I know there are options that can be passed to CLI mode but I was unable to find any actual examples. For example, how to use --test-file-patterns in the context of my 3 questions. An example would make things much clearer on how to use an option.

Thanks!


#4

Hello @jmsc7ran!

Let’s take our Java-demo shop project as an example so that is easier to explain and provide screenshots. The project has the following structure:

Now let’s say that you want to run only the TC2.java test file, via the CLI, the command would be:

[webtestit application path] run --test-file-patterns [path to the TC2.java] [path to the project]

If my project is located on my desktop the whole command would look like this:

"/Applications/Ranorex Webtestit.app/Contents/MacOS/Ranorex Webtestit"  run  --test-file-patterns "/Users/smatijas/Desktop/java-demoshop/src/test/java/uitest/tests/TC2.java"  "/Users/smatijas/Desktop/java-demoshop"

If we add a subfolder to our test folder and another test folder (tests2) to our project and the project structure would look like this:

To execute the TC5.java file in the subfolder:

"/Applications/Ranorex Webtestit.app/Contents/MacOS/Ranorex Webtestit" run --test-file-patterns "/Users/smatijas/Desktop/java-demoshop/src/test/java/uitest/tests/subfolder/TC5.java"  "/Users/smatijas/Desktop/java-demoshop"

And if we want to execute only the TC3 test file located in the newly created (tests2) folder, the command would be:

"/Applications/Ranorex Webtestit.app/Contents/MacOS/Ranorex Webtestit" run --test-file-patterns "/Users/smatijas/Desktop/java-demoshop/src/test/java/uitest/tests2/TC3.java"  "/Users/smatijas/Desktop/java-demoshop"

If you want to run all test files (TC4 and TC5) from the subfolder:

"/Applications/Ranorex Webtestit.app/Contents/MacOS/Ranorex Webtestit" run --test-file-patterns "/Users/smatijas/Desktop/java-demoshop/src/test/java/uitest/tests/subfolder/**" "/Users/smatijas/Desktop/java-demoshop"

Hope this can help you with your project requirements.
Regards


#5

Hello smatijas,
Well…good news and bad news.

Good news is your suggestions worked perfectly, thank you so much for the examples of running Webtestit in CL mode with options. As usual, your team is responsive and helpful. Much appreciated!

Bad news is Webtestit suddenly stopped working for no apparent reason. I’m getting the error “This App can’t run on your PC. To find a version for your pc, check with the software publisher”. If you look at the shortcut to start Webtestit it looks like a blank page icon. I looked in the “C:\Users\jim.martinelli\AppData\Local\Programs\webtestit” folder and the Ranorex Webtestit.exe file is 0 bytes.

Nothing changed on my computer so not sure how this happened. I guess I need to re-install Webtestit but before I do is there anything you want me to check?

Thanks,


#6

Oh bummer :confused:
Honestly, the only thing that I can think of that caused this is a canceled/broken automatic update process.
If you haven’t used Webtestit for a while and a new version rolled out in the meantime, the auto-update process will start immediately when new version is available.
The new version is downloaded in the background with a download progress percentage indicator on the status bar. The Next time when you exit or restart Ranorex Webtestit the installation of the new version is being executed. Maybe something like shutting down your PC or something else happened due to this process and the new version’s installation couldn’t be completed…
We are sorry for the inconvenience, re-installing Ranorex Webtestit will surely fix the issue, and your projects won’t be lost.
Regards,
Sasa


closed #7