Encounter a problem, when testsolution is started by Jenkins

Bug reports.
Bytex
Posts: 8
Joined: Wed Mar 13, 2019 11:56 am

Encounter a problem, when testsolution is started by Jenkins

Post by Bytex » Wed Mar 13, 2019 12:55 pm

Hello everyone,

maybe one of you has an idea what is causing the problem we encounter with Ranorex atm.

We finished a few testsolutions which are running perfectly fine when:
- Run directly
- Run per Agent

But when we run a testsolution by Jenkins we encounter the following problem:
The first steps in all these solutions are:
1) Opening a browser and load a website
2) Filling in the Username and Password into the specific fields by Key Sequence
Step two isn't working, because Ranorex doesn't fill those fieds. But weird is, that we can see how Ranorex is "entering" those fields, just not "typing" in the given Key Sequence.

We already tried opening with other browser, do a "set value" instead of Key Sequence, perform a focus before the key sequence, set a delay between the steps, but nothing really works.
Even more confusing to us is, that one time or another it works, but in the most cases it don't work.
Ranorex now waits for the next page to load, it doesn't throw a failure or sth., it passes through the key squences as if it worked.

Thank you in advance for any help.

Edit:
- Ranorex Version 9.0.0
- Operating System Windows

Vega
Posts: 222
Joined: Tue Jan 17, 2023 7:50 pm

Re: Encounter a problem, when testsolution is started by Jenkins

Post by Vega » Wed Mar 13, 2019 8:27 pm

Are you able to share your compressed Ranorex report from the Jenkins server by chance? I know your test is logging in and you may not want to make your credentials public, so perhaps you could enter bogus credentials for this test run. I would also add a teardown section to the failing test case which takes a Ranorex snapshot of your application at the time of failure. This would allow us to examine what Ranorex can see at the time of failure and compare to the report. Even better since you are using Ranorex 9, you can turn on the new video recording feature to record your test case on failure.

Do you notice any black screenshots in the report? If so, this is an indicator that the user session that the test is being executed in is either locked OR your test is being executed from a service (Jenkins defaults as a service if I recall correctly and you must set Jenkins to run as a process) and your test must be executed in the process space.

A key indicator when your test is failing due to Jenkins running as a service is that your AUT will be launched by your test just fine, but most if not all other steps do not work.

Hope this helps

Bytex
Posts: 8
Joined: Wed Mar 13, 2019 11:56 am

Re: Encounter a problem, when testsolution is started by Jenkins

Post by Bytex » Thu Mar 14, 2019 1:28 pm

Hello and thanks for the answer,

I unfortunately can't share any Reports or the Solution itself, due to data protection and privacy policy of the company. I know that's those information / data improves the possibility to help and I am sorry that I can't provide this.

Back to your mentions:
- No I don't notice any black screenshots in the Report.
- Jenkins is not fresh, it has been set up in the past and worked correct until now. It even works with solutions, which have already been finished, but use the same recording for the login. And there it works.

Maybe this is interesting:
As a workaround I again put a "Mouseclick" and a "Delay 500ms) before the actual input in the affected fields starts. Since that it works through Jenkins. But what's the difference between running the solution on the computer/by agent and jenkins, while it runs?
By the way: Agent and Jenkins both start the testsolution on the same "device".

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

Re: Encounter a problem, when testsolution is started by Jenkins

Post by odklizec » Thu Mar 14, 2019 1:43 pm

Hi,

What's your Ranorex version? Are you using most recent 8.3.3 or 9.0? If not, please update Ranorex.

Unfortunately, without seeing your solution (at very least reports) and Jenkins setup, it's hard tell what could be wrong. I'm working with Ranorex and Jenkins for a very long time and I'm not experiencing such kind of issue? And most of my projects are web-based apps with login. However, it's important to keep both Ranorex and Jenkins updated! So if you are using an old version of Ranorex and/or Jenkins, you should update them. Working with old versions of Ranorex and Jenkins could have some unwanted side effects, not to mention that using obsolete and not updated Jenkins is a security issue!
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

Bytex
Posts: 8
Joined: Wed Mar 13, 2019 11:56 am

Re: Encounter a problem, when testsolution is started by Jenkins

Post by Bytex » Thu Mar 14, 2019 1:57 pm

Hello odklizec,

thanks for your answer.
As mentioned in my first post, Ranorex is on 9.0.0 and Jenkins always gets updated as well, as soon as there is a stable update.

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

Re: Encounter a problem, when testsolution is started by Jenkins

Post by odklizec » Thu Mar 14, 2019 2:03 pm

Hi,

Sorry, I missed the line about Ranorex version in your initial post ;) Well, the truth is, that 9.0 changed something in the way there are performed mouse clicks, but these changes, I guess, should not affect the keysequence action? Anyway, have you tried to toggle "Use asynchronous dispatching of mouse and keyboard events" option (Settings >> Advanced tab)?
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

Bytex
Posts: 8
Joined: Wed Mar 13, 2019 11:56 am

Re: Encounter a problem, when testsolution is started by Jenkins

Post by Bytex » Fri Mar 15, 2019 8:08 am

odklizec wrote:
Thu Mar 14, 2019 2:03 pm
Hi,

Sorry, I missed the line about Ranorex version in your initial post ;) Well, the truth is, that 9.0 changed something in the way there are performed mouse clicks, but these changes, I guess, should not affect the keysequence action? Anyway, have you tried to toggle "Use asynchronous dispatching of mouse and keyboard events" option (Settings >> Advanced tab)?
Hi,

that wasn't meant evil, I hope you didn't understood it like that :shock:

Ah well, the "Use asynchronous dispatching of mouse and keyboard events" is checked and was checked all the time. I could give it a try to toggle.
What makes the whole thing ridiculous for me, this problem only encounters when going by Jenkins. Also: Older Solutions which uses just the same recording for the login, are working just fine.
If suddenly all solutions would start getting this problem, I would be less confused, but just some of the new. And even more confusing for me is, that in one or two of ten tries, it works as well.

Fortunately the workaround temporary solves this issue for us. I even removed the focus, so it's just a "Mouseclick" and a 500ms delay before the input.

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

Re: Encounter a problem, when testsolution is started by Jenkins

Post by odklizec » Fri Mar 15, 2019 8:42 am

Hi,

I'm, of course, not offended in any way ;)

As for your problem, if the recording works with other web apps and just this one don't, then my another guess is, that the implementation of the login, for this particular web, is somehow different? It does not explain, why it does not work just with Jenkins. Sadly, without knowing more details, it's hard to tell what's wrong? It could very well be another not-yet-seen issue, related to 9.0 improvements? It seems that the performance improvements have some unwanted side-effects in many web-related areas. I think we will have to wait for 9.0.1, which should fix (hopefully) all of them? ;)
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

Bytex
Posts: 8
Joined: Wed Mar 13, 2019 11:56 am

Re: Encounter a problem, when testsolution is started by Jenkins

Post by Bytex » Thu Mar 21, 2019 8:26 am

odklizec wrote:
Fri Mar 15, 2019 8:42 am
Hi,

I'm, of course, not offended in any way ;)

As for your problem, if the recording works with other web apps and just this one don't, then my another guess is, that the implementation of the login, for this particular web, is somehow different? It does not explain, why it does not work just with Jenkins. Sadly, without knowing more details, it's hard to tell what's wrong? It could very well be another not-yet-seen issue, related to 9.0 improvements? It seems that the performance improvements have some unwanted side-effects in many web-related areas. I think we will have to wait for 9.0.1, which should fix (hopefully) all of them? ;)
Hello,

I'm sorry it took a while since my last answer.
Good you weren't offended :)

I tried your last mentioned workaround, but it didn't changed this particular problem.
We also think it might have to be the 9.0 which causes this, for any unknown reason.
Let's hope that 9.0.1 maybe fixes this. Until that, we got our workaround working.

Thank you for your help!

Btw: One little question at the side
Since the 9.0.0 when a collegue or I click on a method or sth (STRG+leftMouseclick [CTRL+leftMouseclick]]), the page which opens and shows where the method is, has got an unreadable style. It's like (dark theme) dark text on dark background and in the white theme vice versa. We always need to mark all text for getting a readable, but still bad readable style. Do you know a quick and easy solution for this Problem?
Last edited by Bytex on Thu Mar 21, 2019 2:41 pm, edited 1 time in total.

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

Re: Encounter a problem, when testsolution is started by Jenkins

Post by odklizec » Thu Mar 21, 2019 9:14 am

Hi,
Bytex wrote:
Thu Mar 21, 2019 8:26 am
Btw: One little question at the side
Since the 9.0.0 when a collegue or I click on a method or sth (STRG+leftMouseclick), the page which opens and shows where the method is, has got an unreadable style. It's like (dark theme) dark text on dark background and in the white theme vice versa. We always need to mark all text for getting a readable, but still bad readable style. Do you know a quick and easy solution for this Problem?
It took me a while to understand what do you mean by STRG (CTRL) but I now see what's your problem. It seems it's an unwanted side effected (bug) of new "dark" studio theme? ;) And it seems it happens only with internal Ranorex methods? The funny thing is, it does not matter which theme you are using (black or white), the CTRL+click always opens internal class with black background and black text ;) So yes, it's definitely a Ranorex Studio 9.0 bug.
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

Bytex
Posts: 8
Joined: Wed Mar 13, 2019 11:56 am

Re: Encounter a problem, when testsolution is started by Jenkins

Post by Bytex » Thu Mar 21, 2019 2:41 pm

odklizec wrote:
Thu Mar 21, 2019 9:14 am
Hi,
Bytex wrote:
Thu Mar 21, 2019 8:26 am
Btw: One little question at the side
Since the 9.0.0 when a collegue or I click on a method or sth (STRG+leftMouseclick), the page which opens and shows where the method is, has got an unreadable style. It's like (dark theme) dark text on dark background and in the white theme vice versa. We always need to mark all text for getting a readable, but still bad readable style. Do you know a quick and easy solution for this Problem?
It took me a while to understand what do you mean by STRG (CTRL) but I now see what's your problem. It seems it's an unwanted side effected (bug) of new "dark" studio theme? ;) And it seems it happens only with internal Ranorex methods? The funny thing is, it does not matter which theme you are using (black or white), the CTRL+click always opens internal class with black background and black text ;) So yes, it's definitely a Ranorex Studio 9.0 bug.
Oh embarrassing moment... :D That's a german related problem, for us CTRL is STRG. Sorry that you had to spend a while to understand what I meant by that :D
Yep that's exactly the problem I encounter when opening internal Ranorex methods.
So I'm doing it just right and it's a bug :D Thanks for the information :)