Frustrating object identifications and item property...

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Frustrating object identifications and item property...

Post by fimo420 » Wed Jul 08, 2015 12:35 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Frustrating object identifications and item property...

Post by Support Team » Thu Jul 09, 2015 7:41 am

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
wait_for_document_loaded.PNG (4.23 KiB) Viewed 1283 times
Please let us know if this solved your issue.

Regards,
Johannes
.
Image

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Frustrating object identifications and item property...

Post by fimo420 » Thu Jul 09, 2015 10:35 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Frustrating object identifications and item property...

Post by Support Team » Mon Jul 13, 2015 11:31 am

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
js_dialog.PNG (19.41 KiB) Viewed 1239 times
Regards,
Johannes
.
Image

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Frustrating object identifications and item property...

Post by fimo420 » Wed Jul 15, 2015 8:01 pm

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.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Frustrating object identifications and item property...

Post by Support Team » Thu Jul 16, 2015 1:38 pm

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
.
Image

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Frustrating object identifications and item property...

Post by Support Team » Thu Jan 07, 2016 11:04 am

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
ModalDialog_Firefox.png (17.68 KiB) Viewed 963 times
Regards,
Johannes
.
Image