Page 1 of 1

Ranorex with Jenkins

Posted: Tue Apr 24, 2018 7:35 pm
by LeenaSharma
Hi,

I am trying to integrate Ranorex with Jenkins.
I added the relevant plugin and added a task to run the solution file. But I am getting following error.

Executing : cmd.exe /C ATS.exe /runconfig:testrun /reportfile:C:\Users\qnflee01\.jenkins\workspace\RP3\RanorexTS\ATS\ATS\%S_%Y%M%D_%T.rxlog
[ATS] $ cmd.exe /C ATS.exe /runconfig:testrun /reportfile:C:\Users\qnflee01\.jenkins\workspace\RP3\RanorexTS\ATS\ATS\%S_%Y%M%D_%T.rxlog
'ATS.exe' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Run a Ranorex test suite' changed build result to FAILURE
Finished: FAILURE

Please help to resolve

Re: Ranorex with Jenkins

Posted: Tue Apr 24, 2018 11:21 pm
by tvu
Hi LeenaSharma,

Which plugins did you install? As far as I know, you don't need any Ranorex specific plugins. From your description, the error indicates that you are not in the correct directory when executing ATS.exe.

I am not sure where you are running this command, but you can do the following.
  • In a Jenkins job, add a "Execute Windows batch command" build step
  • In the build step, run a CD command to navigate to where your ATS.exe file is located. (i.e. cd C:\Workspace\Ranorex\ATS\ATS\bin\debug\)
  • In the same build step, run your test suite with the following command. "ATS.exe /runconfig:testrun /reportfile:C:\Users\qnflee01\.jenkins\workspace\RP3\RanorexTS\ATS\ATS\%S_%Y%M%D_%T.rxlog"
  • No need to use the "cmd.exe /C" command
Hope that helps.

Re: Ranorex with Jenkins

Posted: Wed Apr 25, 2018 8:32 am
by odklizec
Hi Tvu,

I guess he is referring to Ranorex integration plugin, which replaces "Execute Windows batch command" build step.

LeenaSharma,
Have you tried to run the ats.exe manually? I mean, go to the bin folder, in which Jenkins build created ats.exe and try to run the file. Does it works?

Are you sure you have Ranorex plugin configured properly? Please post entire content of "Ranorex Summary" found in Jenkins job console output...
*************Start of Ranorex Summary*************
...
...
...
*************End of Ranorex Summary*************

Re: Ranorex with Jenkins

Posted: Thu Apr 26, 2018 1:54 pm
by yaro2o
Hi, recently I've integrated ranorex with jenkins, and I remember, I launched it manually in cmd as admin and this work

Re: Ranorex with Jenkins

Posted: Fri May 04, 2018 11:50 am
by LeenaSharma
Hi All,

Thanks for your reply. Please refer more details of this issue as below -

- I created a free style project in Jenkins with name of 'RP3'.
- Under Source code management section of configurations, I configured to pull the automation code from stash and save in into a sub directory. Gave the path of sub directory as '.\Final\RanorexTS'.
( Note- Code was pushed into stash after building it once in Ranorex studio. So for now, I have not added a separate task to build it in Jenkins)
- Under Build section of configuration, added "Run a Ranorex Test Studio" task and gave the path of test suite as ".\Final\RanorexTS\ATS\ATS\ATS.rxtst"
- Saved above settings
- Run the build

Result -
- Checkout of code works fine. In log it shows that the code is checked out correctly in C:\Users\lee\.jenkins\workspace\RP3\Final\RanorexTS
- Running the ranorex suite gives error. Error in the log is as follows -

Started by user [8mha:////4JrYLIusemSPLDlQyvZwCtbiIQTGjNKUP08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/qihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzWEgZu/dLi1CL9xJTczDwAj6GcLcAAAAA=[0madmin
Building in workspace C:\Users\lee\.jenkins\workspace\RP3
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://***.com/stash/scm/atest/adb-functional-tests.git # timeout=10
Fetching upstream changes from https://***.com/stash/scm/atest/adb-functional-tests.git
> git.exe --version # timeout=10
using GIT_ASKPASS to set credentials
> git.exe fetch --tags --progress https://***.com/stash/scm/atest/adb-functional-tests.git +refs/heads/*:refs/remotes/origin/*
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
> git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision f9346047c5365b339b765e3730eee7b967b4e3d1 (refs/remotes/origin/master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f f9346047c5365b339b765e3730eee7b967b4e3d1
Commit message: "scenario for reports"
> git.exe rev-list --no-walk f9346047c5365b339b765e3730eee7b967b4e3d1 # timeout=10
Executing : cmd.exe /C ATS.exe /reportfile:C:\Users\lee\.jenkins\workspace\RP3\Final\RanorexTS\ATS\ATS\%S_%Y%M%D_%T.rxlog
[ATS] $ cmd.exe /C ATS.exe /reportfile:C:\Users\lee\.jenkins\workspace\RP3\Final\RanorexTS\ATS\ATS\%S_%Y%M%D_%T.rxlog
'ATS.exe' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Run a Ranorex test suite' changed build result to FAILURE
Finished: FAILURE




Note : ATS.exe is in C:\Users\lee\.jenkins\workspace\RP3\Final\RanorexTS\ATS\ATS\bin\Debug
If I go to this path and run ATS.exe in console, then it works fine and execute the test suite.


Please help to resolve this issue. I am not sure how it is referring to ATS.exe and does it expect it to be in some other location/folder?

Thanks and Regards,
Leena Sharma

Re: Ranorex with Jenkins

Posted: Fri May 04, 2018 1:26 pm
by odklizec
Hi,

I maybe missing something, but in your description, there is missing MSbuild step in your jenkins job configuration, which should be performed after obtaining source files from GIT?

Also, you mentioned the ats.exe is on this path:
C:\Users\lee\.jenkins\workspace\RP3\Final\RanorexTS\ATS\ATS\bin\Debug
But the path to rxtst you set like this:
\Final\RanorexTS\ATS\ATS\ATS.rxtst
You see, there is missing \bin\debug\ part of path, where the exe is usually stored after successful msbuild action.

Re: Ranorex with Jenkins

Posted: Mon May 07, 2018 6:47 am
by LeenaSharma
yes, seems I have moved one step further now. The path that I was giving to Ranorex plugin was of a non complied test suite file.
Now I changed it to the one that is in the bin\debug folder(same where ATS.exe is located).

Now I am getting another issue as following -


On running the job, Jenkins is showing following error in the log file.
Could not load file or assembly 'Ranorex.Core.Resolver, Version=8.1.0.0, Culture=neutral, PublicKeyToken=b798506b574ebc9a' or one of its dependencies. The system cannot find the file specified.

If I try to run ATS.exe directly from command prompt, then also I am getting this issue.

I have already checked the "Copy runtime to Output" in Ranorex settings.

Thanks,
Leena

Re: Ranorex with Jenkins

Posted: Mon May 07, 2018 7:22 am
by odklizec
Hi,

I believe it should help if you simply remove the Ranorex.Core.Resolver reference from your project or if you switch target CPU to x86.

Re: Ranorex with Jenkins

Posted: Mon May 07, 2018 8:32 pm
by dpFourOFour
Hi Leena,

Seems that MSBuild is not able to find the Ranorex Core Resolver assembly. All Ranorex assemblies are afaik copied to the bin/debug if you have enabled the "copy runtime to output", but usually the bin/debug folder is excluded in source control tools. I'd suggest installing Ranorex on the specific machine to ensure all assemblies are available to build the test exe.

Hope that helps,
DP