problem with identifying dialog controls in IE/FF

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

problem with identifying dialog controls in IE/FF

Post by odklizec » Wed Feb 18, 2015 11:22 am

Hi folks,

I'm experiencing a problem with with identifying controls in IE/FF security/login dialog. The strange thing is that the problem appears only during the test run! All controls are correctly identified fine in Studio (if selected and highlighted in repository or examined with spy). There are definitely no multiple instances of these elements during runtime and the dialog/elements have, in my opinion, not so complicated paths? As mentioned before, in Studio, all elements are found fine and nearly instantly.

In the attached file you can find the sample project.
LoginTest.zip
(112.07 KiB) Downloaded 63 times
What I want to achieve is to have one repository dialog entry, with two edit boxes and one OK button. All controls should be recognized both in IE and FF. I've found common attributes and assembled universal paths recognized in both browsers. Any idea what could be a problem?

To be honest, I'm quite new in web-based automation. So far I worked only with desktop apps. So maybe I'm missing something small but pretty important? ;)

I'm using Ranorex 5.2.2. Thank you in advance!
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
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: problem with identifying dialog controls in IE/FF

Post by odklizec » Wed Feb 18, 2015 12:23 pm

OK, I just found one more clue to the problem. It seems that the elements are found if during search phase I deliberately set focus to another window/dialog (e.g. by clicking to Ranorex console window). After this action, Ranorex quickly finds the element and performs expected action. But then it's again stuck on search for next element. Another click outside the login dialog is needed to make Ranorex to find the control. This is really weird.
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
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: problem with identifying dialog controls in IE/FF

Post by odklizec » Wed Feb 18, 2015 1:24 pm

OK, problem solved ;) I got an idea to instruct Ranorex to save the dialog snapshot before attempt to click the problematic elements. From the snapshot I realized that the paths I constructed were not quite unique as recognized via Studio. So after editing them, Ranorex is now able to recognize all elements.

Here is an example of old and new (correct) path...

Code: Select all

user name old:
/form[@processname=$rpBrowserProcName and @accessiblerole='Dialog']//element?/?/text[@accessiblename~'User (N|n)ame' and @accessiblestate='Focusable' and @accessiblerole='Text']

Code: Select all

user name new: 
/form[@processname=$rpBrowserProcName and @accessiblerole='Dialog']//element?/element?[@accessiblestate!='readonly']/text[@accessiblename~'User (N|n)ame' and @accessiblerole='Text']
The only remaining problem was that even though the controls are now recognized, SetValue failed with Firefox text inputs with below error...

Code: Select all

Setting attribute 'Text' failed on element '{Text:User Name:}'.
The operation is not supported.
The method or operation is not implemented. 
I solved it by using KeySequence instead of SetValue ;)
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