Different results between local and CI run

Ask general questions here.
User avatar
HugovdB
Posts: 4
Joined: Fri Sep 18, 2020 2:31 pm

Different results between local and CI run

Post by HugovdB » Fri Sep 18, 2020 2:42 pm

I am relatively new so forgive me if this is not the correct place to ask this question. I've tried searching the forum for a similar problem but could not (easily) find it.
I am testing a web based application and sometimes when the browser is closed it will throw a dialog to warn the visitor they are leaving the site without saving possible changes. This is all good and I've added some custom user code to the closebrowser recording to deal with the dialog. This code works fine on my local machine, also with Ranorex closed and just executing the .exe file but for some reason does not work on my CI Agent. It simply does not click the ButtonLeave and does not close the browser as the dialog is preventing this.
I've tried increasing the Duration in the Exists validation but this did nothing for me.

Code: Select all

public void Validate_Dialog(RepoItemInfo formInfo, RepoItemInfo buttonInfo)
        {

        	if (repo.LeaveSite.DialogInfo.Exists(new Duration(4000))) {
            	Report.Log(ReportLevel.Info, "Validation", "Dialog does exist, so click leave.", formInfo);
				
            	repo.LeaveSite.ButtonLeave.Click();
            }
            else {
            	Report.Log(ReportLevel.Info, "Validation", "Dialog does NOT exist, browser closed", formInfo);
            }
        }
I have a pipeline set up in Azure Devops which works fine as long as the dialog is not thrown.

If any more information is required just let me know.
Hugo van den Berg
Test Lead at4PS

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

Re: Different results between local and CI run

Post by odklizec » Mon Sep 21, 2020 7:18 am

Hi,

I'm afraid, there is not much anyone here can do or suggest without seeing, at very least, a Ranorex snapshot (NOT screenshot) of web page in expected state, taken on both environments and xpaths behind formInfo and buttonInfo elements.

In my opinion, the best you can do is to log to the CI machine (via remote desktop) and debug the problem with Ranorex Studio installed directly on that machine. I assume that there is different OS or something else different on that machine?
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

User avatar
HugovdB
Posts: 4
Joined: Fri Sep 18, 2020 2:31 pm

Re: Different results between local and CI run

Post by HugovdB » Mon Sep 21, 2020 12:11 pm

odklizec wrote:
Mon Sep 21, 2020 7:18 am
... I assume that there is different OS or something else different on that machine?
Turns out, there was :oops: I installed Ranorex studio on the agent and ran the script there too. Failed....

After this comment I looked further into possible differences and it turned out to be so simple... The language settings for the browser on the agent turned out to differ from mine and the object's xpath differed due to that. I've changed to xpath to be language independent and now everything works just fine. Feel so silly.....
Hugo van den Berg
Test Lead at4PS

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

Re: Different results between local and CI run

Post by odklizec » Mon Sep 21, 2020 12:18 pm

Hi,

Nice to hear you found the difference. There is no need to feel bad about this. We all make errors from time to time ;)
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