Ranorex Azure build task.

Ask general questions here.
dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Ranorex Azure build task.

Post by dmconsulting1 » Tue Nov 26, 2019 5:39 pm

I am trying to figure out how to fire the build on a test PC, not the build server. Looking at the setting, I don't see a way to launch the test suite on that PC over the network. Do I need to have the test executable located on the build server, then have Ranorex log into the test PC to actually run it?

Am I missing something? I need to be able to add authentication to the process and be able to run on a remote pc. Thanks.

dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Re: Ranorex Azure build task.

Post by dmconsulting1 » Tue Nov 26, 2019 6:22 pm

I have added the agent to the test PC, but I am not sure how to call the agent from the build task.

dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Re: Ranorex Azure build task.

Post by dmconsulting1 » Tue Nov 26, 2019 11:00 pm

Ok, I tried using the command line to kick off the agent, but the test run fails.

System.IO.FileNotFoundException: Could not load file or assembly 'Ranorex.Bootstrapper, Version=9.2.0.0, Culture=neutral, PublicKeyToken=b798506b574ebc9a' or one of its dependencies. The system cannot find the file specified.
File name: 'Ranorex.Bootstrapper, Version=9.2.0.0, Culture=neutral, PublicKeyToken=b798506b574ebc9a'
at __RxMain.__RxProgram.RanorexInit()
at __RxMain.__RxProgram.Main(String[] args) in C:\Work\P38V&V\P38\obj\Debug\__RxPrograms.g.cs:line 30

I just reinstalled 9.2.0 this morning. I am able to run the project locally from the command line.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6344
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Azure build task.

Post by odklizec » Wed Nov 27, 2019 7:24 am

Hi,

At first, Ranorex cannot login to the desktop, on which you want to run your test. It must already been running and unlocked!

As for the second problem, in my opinion, the test machine does not have all required pre-requisities installed? Have you installed full Ranorex on it?

Of course, you don't have to install entire Ranorex Studio on test machine (if you don't wish to do it). But you still have to make sure that there are installed all required runtime libs! And it's best doing it via Ranorex Studio install, which initially checks the presence of all runtime libs and offers to install the missing ones. After that, it starts the Ranorex Studio setup, which you can freely skip. Hope this helps?

Eventually, you can check and install the required runtimes manually. Check this page, with the list of sw requirements, per each Ranorex version:
https://www.ranorex.com/help/latest/ran ... uirements/
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Re: Ranorex Azure build task.

Post by dmconsulting1 » Wed Nov 27, 2019 3:19 pm

I will install Ranorex 9.2.0 on the test machine today and try that. I thought that the build included all the runtimes to be deployed so that I could use the agent without installing the full studio?

https://www.ranorex.com/help/latest/ran ... ble-build/

From that page:
To execute a test in a runtime environment, you need to include the Ranorex Studio runtime library with the executable build. You do so by activating the option Copy runtime to output in the settings. By default, it is deactivated.


Is there somewhere special I need to put the runtime directory on the test machine? I don't see anywhere in the agent config where I can specify that.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6344
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Azure build task.

Post by odklizec » Wed Nov 27, 2019 3:29 pm

Hi,

I'm sorry for the confusion. With the term 'runtimes', I refer to MS Visual Studio runtimes and .Net libs ;) Of course, once you enable option "Copy runtimes to output", Ranorex copies its own runtimes. But MS runtimes must be still installed on each machine, on which you want to run Ranorex Studio or compiled tests.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Re: Ranorex Azure build task.

Post by dmconsulting1 » Wed Nov 27, 2019 4:21 pm

Ok, that makes sense, thanks for the clarification.

dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Re: Ranorex Azure build task.

Post by dmconsulting1 » Wed Dec 04, 2019 3:56 pm

OK, this build task still doesn't work. Using the same info, I can fire off the test from a Command Task, but using the Ranorex Build Task, it just hangs.

Here is the console output. The agent never gets hit.

******************************************************************************
Starting: Run Ranorex test executable P38.exe on agent: GeodeTestPC
******************************************************************************
==============================================================================
Task : Run Ranorex Studio test executable
Description : Create a build/release task for Azure Pipelines/Team Foundation Server (TFS) that can configure and run Ranorex Studio test executables. Please note that Ranorex licensing supports self-hosted agents only.
Version : 1.0.0
Author : RanorexGmbH
Help : This task makes Ranorex more accessible to the Azure DevOps and TFS community. Ranorex licensing supports [self-hosted agents](https://docs.microsoft.com/en-us/azure/ ... ure-devops) only. [Learn More](https://www.ranorex.com/help/latest/int ... roduction/)
==============================================================================
agent.TempDirectory=C:\agent\_work\_temp
loading inputs and endpoints
loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
loading INPUT_ADVANCEDCMDLINE
loading INPUT_ATTACHREPORT
loading INPUT_ENABLETESTRAIL
loading INPUT_REPORTLEVEL
loading INPUT_REPORTNAME
loading INPUT_TESTEXEPATH
loading INPUT_TESTSUITEPATH
loaded 10
Agent.ProxyUrl=undefined
Agent.CAInfo=undefined
Agent.ClientCert=undefined
Agent.SkipCertValidation=undefined
enableTestRail=false
reportName=%S_%Y%M%D_%T
reportLevel=Success
testExePath=\\GeodeTestPC\RanroexSetupFolder\Ranorex\P38.exe
system.defaultWorkingDirectory=C:\agent\_work\39\s
defaultRoot: 'C:\agent\_work\39\s'
findOptions.allowBrokenSymbolicLinks: 'false'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
matchOptions.debug: 'false'
matchOptions.nobrace: 'true'
matchOptions.noglobstar: 'false'
matchOptions.dot: 'true'
matchOptions.noext: 'false'
matchOptions.nocase: 'true'
matchOptions.nonull: 'false'
matchOptions.matchBase: 'false'
matchOptions.nocomment: 'false'
matchOptions.nonegate: 'false'
matchOptions.flipNegate: 'false'
pattern: '\\GeodeTestPC\RanroexSetupFolder\Ranorex\P38.exe'
findPath: '\\GeodeTestPC\RanroexSetupFolder\Ranorex\P38.exe'
statOnly: 'true'
found 1 paths
applying include pattern
1 matches
1 final results
advancedCmdLine=/agent:http://geodetestpc:8081/api
runConfig=null
attachReport=true
TEMP=C:\agent\_work\_temp
testSuitePath=\\GeodeTestPC\RanroexSetupFolder\Ranorex\_Installation.rxtst
system.defaultWorkingDirectory=C:\agent\_work\39\s
system.defaultWorkingDirectory=C:\agent\_work\39\s
defaultRoot: 'C:\agent\_work\39\s'
findOptions.allowBrokenSymbolicLinks: 'false'
findOptions.followSpecifiedSymbolicLink: 'true'
findOptions.followSymbolicLinks: 'true'
matchOptions.debug: 'false'
matchOptions.nobrace: 'true'
matchOptions.noglobstar: 'false'
matchOptions.dot: 'true'
matchOptions.noext: 'false'
matchOptions.nocase: 'true'
matchOptions.nonull: 'false'
matchOptions.matchBase: 'false'
matchOptions.nocomment: 'false'
matchOptions.nonegate: 'false'
matchOptions.flipNegate: 'false'
pattern: '\\GeodeTestPC\RanroexSetupFolder\Ranorex\_Installation.rxtst'
findPath: '\\GeodeTestPC\RanroexSetupFolder\Ranorex\_Installation.rxtst'
statOnly: 'true'
found 1 paths
applying include pattern
1 matches
1 final results




And it just sits there. I had to put the Runtimes and test executable on the test PC and reference them in the task. When the runtimes were on the build server, Ranorex failed to see them. When the test executable was on the build server, it also failed to see it. So I had to create a network share on the test PC and have them available there in order for it to run at all.

If I run the Command Task, there is a timeout warning in the script (there is another thread about that, still unresolved) and the test succeeds, but reports as failed to TFS with an Exit Code -1.

dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Re: Ranorex Azure build task.

Post by dmconsulting1 » Wed Dec 04, 2019 4:21 pm

Here is the output from the Command Task:

Execute test suite
Test execution failed
Report: C:\agent\_work\39\s\_Installation_20191204_071218.rxzlog
Report: C:\agent\_work\39\s\UI_VV_20191204_071215.rxzlog
Job completed: Error
Process completed with exit code -1.
System.Exception: Process completed with exit code -1.



If you look at the log, it was a success, so I don't understand why it reports as a failure.

dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Re: Ranorex Azure build task.

Post by dmconsulting1 » Wed Dec 04, 2019 8:15 pm

Thanks to Ned, I got the Ranorex build task to successfully kick off my test suite. I had to specify the relative path to the test suite and it seems the plug in doesn't like multiple test suites or supports them.

So now I will build a Build Validation Test Suite that includes all the tests.

dmconsulting1
Posts: 95
Joined: Fri Nov 08, 2019 3:23 pm

Re: Ranorex Azure build task.

Post by dmconsulting1 » Mon Dec 16, 2019 7:56 pm

So at the bottom of this article:
https://www.ranorex.com/help/latest/int ... -pipeline/

Set the test result format to JUnit.

As test results files, specify **/*.xml.


TFS reports an error:

Processed: ##vso[task.logissue type=warning]Failed to read C:\agent\_work\37\s\Reports\BuildReport.rxlog.junit.xml. Error : Data at the root level is invalid. Line 23, position 13.
Invalid results file. Please make sure the Test Result Format field in the task matches the result format of the file: C:\agent\_work\37\s\Reports\BuildReport.rxlog.junit.xml
Processed: ##vso[task.logissue type=warning]Invalid results file. Please make sure the Test Result Format field in the task matches the result format of the file: C:\agent\_work\37\s\Reports\BuildReport.rxlog.junit.xml
Leaving script PublishTestResults.ps1

So what am I doing wrong with this reporting piece?