Page 1 of 1

Frustrating object identifications and item property...

Posted: Wed Jul 08, 2015 12:35 pm
by fimo420
Hi guys,

I've been having this issue with Ranorex finding objects on our webpage.
This is so confusing and i don't know why it's keep happening and always random behaviors so wonder if you guys can help finding the issue or push me into right direction?

The way i have setup my tests is that whenever it clicks, navigates to pages etc always verifies the object is shown and exists. But the issue is that sometimes Ranorex reports the item is visible while other times it says its not visible even tough its there on screen. This is making all my tests so fragile and not safe at all since i have 50-50 chance that it will pass or fail even tough it should always pass.

I've tried many way to fix this:

Code: Select all

ex:
itemInfo.WaitForExists(duration);
itemInfo.WaitForNotExists(duration); 

Custom methods where it takes an item/adapter as parameter or repoiteminfo and loops through while for an x amount of times till it finds before moving on or fails.

bool found = Host.Local.TryFindSingle<Ranorex.InputTag>(path, 10000, out item);
bool found = Host.Local.TryFindSingle(path, 10000, out item); 
*path in differentstyles, like wholepath, or simple, or just the item path:
"//legend[@innertext='sometext']"
".//legend[@innertext='sometext']"

bool validate = Validate.NotExists(elementPath, new Duration(timeout), "Check Object '{0}'",new Validate.Options(false, ReportLevel.Info));

var element = Host.Local.FindSingle(path, timeout);
if(element.visible) etc..

I mean all this should give me the item as shown 100% always the time right unless i'm missing something really obvious here. Anyone else having similar issues or solved it?
I mean i can fix the problem by adding manual delays all over the places, but i hate that and dont want to use it at all. There has to be away for me to say to Ranorex, click here and wait till you see the title on next page and then move on etc... I've built this customs in Selenium and it works perfect while Ranorex is giving me a headache.

I'm using latest Ranorex version and firefox latest version

Re: Frustrating object identifications and item property...

Posted: Thu Jul 09, 2015 7:41 am
by Support Team
Hello fimo420,

It would be great if you could upload a Ranorex Snapshot and a sample RxPath of an element from your website. This would help us in analyzing the issue.

It looks like the web page has not finished loading when validation is carried out. Ranorex generally supports the workflow which you want to test. As far as I understand you want to wait for the web page being loaded completely, before the validation step is performed.

In order to do this, use the Invoke Action 'WaitForDocumentLoaded()' on the corresponding dom-element. Just drag and drop the dom-element from your repository to your recording and select the method.
wait_for_document_loaded.PNG
Please let us know if this solved your issue.

Regards,
Johannes

Re: Frustrating object identifications and item property...

Posted: Thu Jul 09, 2015 10:35 am
by fimo420
Hi Johannes,

Thanks for the reply.
I'm tried with WaitForDocumentLoaded(), like i said its very random behavior.
I've debugged the tests and i can see the item where it stops and when i try to find the item ranorex reports false even tough its on screen. And i've tried to redo the steps twice in the loop just to make sure the item is visible if it was a timing delay it would miss first time but the next time it should definitely find it right?

Our webpage has a lots of iframes, popups and modal dialog's based on angular.js dont know if thats the problem?
I'm gonna email you guys a snapshot from our application

Re: Frustrating object identifications and item property...

Posted: Mon Jul 13, 2015 11:31 am
by Support Team
Hello fimo420,

thank you for sending us your snapshot.

We currently analyze, why we have problems with tracking these JavaScript dialogs within Firefox.

Meanwhile, as a workaround, it is possible to navigate to the corresponding dialog elements using Ranorex Spy. These elements can be found within the Firefox form element.
js_dialog.PNG
Regards,
Johannes

Re: Frustrating object identifications and item property...

Posted: Wed Jul 15, 2015 8:01 pm
by fimo420
Hi Johannes,

I know it's possible to find with Ranorex spy, but it does not work when run the test in code. It's random sometimes it finds sometimes it doesnt. And i've even tried to wait with hard delay(5s) it just doesn't work, the items comes up right away.

Re: Frustrating object identifications and item property...

Posted: Thu Jul 16, 2015 1:38 pm
by Support Team
Hello fimo420,

May I ask if you received our email? We sent you a detailed description about the issue on Friday, 07/10/2015.

Please reply to this email if the described steps could not solve your issue.

Regards,
Johannes

Re: Frustrating object identifications and item property...

Posted: Thu Jan 07, 2016 11:04 am
by Support Team
Hello,

There is another way to record/track such dialogues in Firefox.

Please carry out the following steps to change the corresponding Firefox setting:
1) Open Firefox
2) Navigate to "about:config" (enter it in the address bar)
3) Search for "prompts.tab_modal.enabled" and change the value to "false"

Consequently, the modal dialog will be identified as a separate form and not as part of the UI structure of the browser. Note that the previously created path will no longer work after changing this setting.
ModalDialog_Firefox.png
Regards,
Johannes