Drop down selections and validation

Best practices, code snippets for common functionality, examples, and guidelines.
Posts: 37
Joined: Wed Feb 26, 2020 2:17 pm

Drop down selections and validation

Post by mmahra » Mon Mar 02, 2020 8:00 am


I am trying to select and validate an item in a drop down menu item
I have seen lots of discussions regarding the same but still not working as expected at my end.
Please check screenshot 1 and 2
in screenshot 1
I want to click on the drop down menu and select Fixed
in second screenshot I want to click on a drop down menu and scroll/directly select to desired value and select it and validate that the drop down Item is selected and equal to x.

Thank you
Last edited by mmahra on Thu Mar 19, 2020 11:18 am, edited 1 time in total.

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

Re: Drop down selections and validation

Post by odklizec » Mon Mar 02, 2020 9:16 am


It would be ideal, if you post entire solution, so we can review the steps. I'm not quite sure, what exactly is your problem? The recordings you posted looks somewhat messy.

At first, you should "merge" actions Down/Up to simple Clicks. Or simply remove them and keep there simple Click. I don't understand why there are Down/Up actions, followed by Click action?

Also, I would recommend to stop using pixel-based mouse coordinates and rather use relative coordinates, like Center, Top, Bottom, etc...
This could be done either manually, or for new actions you can set it in Settings >> Recorder defaults >> Coordinate recording mode >> None. However, this will not affect existing recorded actions! Old actions must be either edited manually, or you can keep them as they are ;)

Also, using Set Value action is somewhat risky and should be used only if you know for sure it will work with your app (depends of the app implementation). Try to use KeySequence action instead.
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