Ranorex is not making actions when executed with Jenkins

Ranorex Studio, Spy, Recorder, and Driver.
julez90
Posts: 13
Joined: Thu Apr 25, 2019 2:32 am

Ranorex is not making actions when executed with Jenkins

Post by julez90 » Mon Nov 30, 2020 9:05 pm

Hello together,

i have really annoying issue that (web-)tests which are executed by Jenkins (not as a service!) are not going to take actions as defined in the modules.

For example:
- Browser will open but no buttons (e.g. login-button) will be clicked (They can be identified without doubt, XPath also correct and robust!)
- "Empty" key sequences BUT ranorex is switching the input-field (e.g. username / password mask)

Setup:
- Ranorex running with latest version
- Ranorex Plugin for Browser and Jenkins with latest update
- Jenkins slave on Virtual Machine (= test environment to run tests on it)
- Jenkins is not started as a service!

Facts:
- Web-Tests definitely did have worked before with Jenkins, but i stopped executing the tests for x months because there was no need
- Active User Session = true! (on VM) (No black screens in test-report)
- Other jenkins project (SAP GUI) is working with -similiar- project settings and -similiar- settings in jenkins-project
- It doesn't matter if i'm doing delays or wait times.. even overdoings 10 second wait times or WaitForExists() in user code modules doesn't resolve the issue
- When running the tests locally and manually via testproject.exe everything works fine (same as on the VM!), but test-project executed via jenkins is not working
- ranorex and browser are started as administrator on VM

Edit:
- Issue appears only with Chrome!
- When I'm executing the test on the vm locally without jenkins it works fine but executed via jenkins not
- I've also made a simple test on www.google.de (typing in "test" in search-field, search and validate something) to verify that it's not caused by a inaccurate xpath or something else which is also working locally but not when executed via jenkins

I'm really confused about this situation. Has anyone made similiar experiences or came in contact with issues like this?


Best regards and thanks in advance!
Julez
You do not have the required permissions to view the files attached to this post.

julez90
Posts: 13
Joined: Thu Apr 25, 2019 2:32 am

Re: Ranorex is not making actions when executed with Jenkins

Post by julez90 » Tue Dec 01, 2020 2:03 pm

Hello,

Issue is fixed now. The Ranorex Chrome Plugin caused this issue. Possible Reason:

Installation of Ranorex Plugin via wizard can only be done as administrator. If i'm not running the wizard as administrator, then it will throw an error after installing process (because of some registry access stuff).

But when I'm installing the plugin as administrator it causes to problems as described before. The plugin is not removable from chrome only via wizard (uninstall) because it is blocked by policy.

I removed the plugin via wizard with admin rights and then installed the plugin directly over the chrome extension marketplace. In this setup everything works fine.

Maybe a help for someone out there.


Best Regards
Julez

vishni
Posts: 14
Joined: Wed May 26, 2021 11:51 pm

Re: Ranorex is not making actions when executed with Jenkins

Post by vishni » Sat Feb 05, 2022 4:05 am

Hi,

Can you please tell me how the user session was set active on VM machine

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

Re: Ranorex is not making actions when executed with Jenkins

Post by odklizec » Mon Feb 07, 2022 7:24 am

Hi,

You may try using a technique, described at bottom of this user guide chapter (keep user session alive):
https://www.ranorex.com/help/latest/ran ... lRDPbrspan

In our company, we are using a 3rd party tool called LogonExpert.
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

julez90
Posts: 13
Joined: Thu Apr 25, 2019 2:32 am

Re: Ranorex is not making actions when executed with Jenkins

Post by julez90 » Mon Feb 21, 2022 11:59 pm

vishni wrote:
Sat Feb 05, 2022 4:05 am
Hi,

Can you please tell me how the user session was set active on VM machine
Hello,

first of all you have to set auto logon on your machine

Here are instructions for auto logon (without using 3rd party tool):
https://docs.microsoft.com/en-us/troubl ... atic-logon

But you can also use SysInternal AutoLogon:
https://docs.microsoft.com/en-us/sysint ... /autologon

or "LogonExpert" like odklizec has already mentioned.


Second you have to ensure, after you connected with your VM via remote desktop connection that you exit the VM with following script (executed as administrator) instead of using the X-Button in the right corner to get back to your local desktop:

Code: Select all

for /f "skip=1 tokens=3 usebackq" %%s in (
 `query user %username%`
) do (
 %windir%\\\\System32\\\\tscon.exe %%s /dest:console
)
You can also replace %username% with a specific user (name). For example if the username of the specific user is ABC then go like this:

%username% => %ABC%

The user "ABC" need admin rights.


If you are using Jenkins as CI / CD Pipeline tool also ensure that the Jenkins slave script is not started as a windows service, because as windows service the slave will have no ability to interact with the UI.

Instead of that just execute the jenkins agent / slave by launching via Java Web Start.


Hope that helps!

BG
julez

vishni
Posts: 14
Joined: Wed May 26, 2021 11:51 pm

Re: Ranorex is not making actions when executed with Jenkins

Post by vishni » Tue Mar 01, 2022 1:40 am

Thanks Julez90, I followed your instructions and it worked fine.
Thanks for detailed steps.