Unable to detect the text box in java application

Ask general questions here.
User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to detect the text box in java application

Post by odklizec » Wed Oct 07, 2015 11:29 am

Hi,

You just need to find an attribute, which is unique for the particular popup. If there is no such unique attribute, you will most probably have to use index number in popup xpath?

Eventually, it may be possible to use relative path from another element, which could redirect Ranorex to the correct popup element? But it's hard to suggest the xpath without seeing the popup in snapshot. Could you please create and post another snapshot, which would contain at least one popup?
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

ejji09
Posts: 54
Joined: Thu Sep 10, 2015 2:48 pm

Re: Unable to detect the text box in java application

Post by ejji09 » Fri Oct 09, 2015 10:15 am

Hi,

Please find the Ranorex snapshot in the below mentioned link
https://app.box.com/s/2p2afqto2x7jj9bddh0gdr9jdp21jacu
Ranorex snapshot with popup

and please find the attchment of Screen shot of the application where you can get a more clear idea how my appliation looks like and what the neccesary fields are there, And in my application on the text fields where ever there is a '!' mark on the text field the Selection F9 popup will appear and its the same for everyone. Please help me out from this issue. :|

https://app.box.com/s/tjdydojx6exb2rt0xafbhe0fifp2bmvg
Screen shot of the application

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

Re: Unable to detect the text box in java application

Post by odklizec » Fri Oct 09, 2015 11:27 am

Hi,

In the last snapshot you uploaded, there appears to be just one popup. But if I understand you right, it's possible to have multiple "Selection" popups displayed at the same time? So could you please create and post a snapshot with multiple "Selection" popups?

Anyway, from where the "Selection" popup appears in the element tree, I don't think there is a way to match the currently selected input field with its "Selection" popup. Simply, the "Selection" popup appears to be something independent from the input field and accessible directly from element tree root. There are also no attributes, which could be used to match the particular "Selection" popup with its owner.

So my best suggestion is that you should make sure there is always displayed just one "Selection" popup during your tests. In this case, no matter which field you are currently in, the path ?/?/menuitem[@text='Selection'] should always select only the one existing popup?

Another suggestion is to present your problem to devs./managers and ask them to implement nice unique IDs so you can match the Selection popup with its owner. But I guess this will be a long shot ;)
Attachments
DateOfBirth_Selection.png
DateOfBirth_Selection.png (73.46 KiB) Viewed 542 times
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

ejji09
Posts: 54
Joined: Thu Sep 10, 2015 2:48 pm

Re: Unable to detect the text box in java application

Post by ejji09 » Fri Oct 09, 2015 12:43 pm

Hi,

Now I have uploded a new snapshot where i used the Selection F9 popup for date of birth to select the date of birth and even for postcode i used the Slection F9 popup to select teh post code.

And what happens in actually is that when ever i track the popup for date of birth and again try to track the popup of postcode in repository it shows me the Date of birth popup. whose path is ?/?/menuitem[@text='Selection']

Please find the link of Ranorex snapshot
https://app.box.com/s/hufsnh04ardndzfmxqcwtqidrtfmqmdi

Please find the screen shot of the application with popup
https://app.box.com/s/5hh9c75sonihrs58g1ho3px8lefs7rcb

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

Re: Unable to detect the text box in java application

Post by odklizec » Fri Oct 09, 2015 1:36 pm

Hi,

The snapshot you just posted also contains only one "Selection" popup. So in my opinion, there is always issued the same "Selection" popup for any selected input element? Therefore, the path ?/?/menuitem[@text='Selection'] should always select the same popup.

In other words, there is no separate "Selection" popup issued for each input. It's always the same popup, it may just have different content/functionality, based of the selected input. No matter if you click in "Date of birth" or "Postcode" input, the above xpath should always find the "Selection" popup?

Could you please describe what are the steps in your test and what exactly happens? What you want to do with the "Selection" popup? And what error exactly are you getting if you run your test?
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

ejji09
Posts: 54
Joined: Thu Sep 10, 2015 2:48 pm

Re: Unable to detect the text box in java application

Post by ejji09 » Fri Oct 30, 2015 9:57 am

yes you are right!

When ever i click either Date of bith or Postcode it shows the Selection pop who path is same for both Date of birth and Postcode, but the functionality of the pop up changes according to the selected input. And i want to solve this because i cannot give the Date of birth manually by typing the only way to give the Date of birth is that i have to select it from the popup(a calender will apperas and i have to select from it) and its the same for Postcode also. when i click the Postcode Selection popup(a list of post codes will appear i have to select from them).

How to overcome this issue?

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

Re: Unable to detect the text box in java application

Post by odklizec » Fri Oct 30, 2015 11:31 am

Hi,

If I understand you right, after clicking the "Selection F9" popup, there appears different GUI for entering date of birth (calendar) or Postcode (selection list with postcodes), right? So what you need to do, is to have two different sets of actions and use each set of actions based of the action you are going to perform?

I mean, this "Selection F9" popup is irrelevant anyway, because it's always the same. And if I understand the logic of your AUT right, there is always only one "Selection F9" popup displayed? I mean, there should not be displayed two "Selection F9" popups at the same time, right?

So in your test, when you click a "date of birth" input, there appears "Selection f9" popup. So then you need to click this popup or send "F9" shortcut? This action could be common for all inputs (date of birth, postcode, etc...). Only the following actions must be different, based of the context GUI invoked by Selection F9 popup. And here you should use some kind of logic operation, which would enable these actions based of last clicked input.
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

ejji09
Posts: 54
Joined: Thu Sep 10, 2015 2:48 pm

Re: Unable to detect the text box in java application

Post by ejji09 » Fri Oct 30, 2015 12:01 pm

Finally solved the issue by using:

code:

Code: Select all

Keyboard.Press("{F9}");
Actually i got this idea when you said that
send "F9" shortcut?
Big Thanks to you. :D

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

Re: Unable to detect the text box in java application

Post by odklizec » Fri Oct 30, 2015 12:05 pm

Nice to hear you solved the problem! ;)
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