Message box content - Validation help !

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Ram_Sankar
Posts: 13
Joined: Mon Mar 17, 2014 8:17 am

Message box content - Validation help !

Post by Ram_Sankar » Mon Mar 31, 2014 7:36 am

Good Morning All,

I am still new to Ranorex and have never done coding on this so far. My new task is to write a validation code :cry: to check a certain value that gets displayed in the message box. But when I use the PathEditor, the entire content in message box gets selected and I am not able to narrow it down to that one particular data item from the messagebox. :x

Any expert suggestions on these areas will be welcome as this is a crucial stage for me to progress through. the message box extracts data from sql and has a wide range of many other data that it displays. However, I should look for one in particular and if that matches, I should click the OK button.

Can someone please help? :roll:

Thanks in anticipation.
R

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

Re: Message box content - Validation help !

Post by odklizec » Mon Mar 31, 2014 9:16 am

Could you please post a snapshot of the message box? If the Spy highlights all elements, then your path is not unique enough to select only the element you need to validate.

BTW, do you really need to use the code to validate the value in message box? If you are using Recordings, then you can either add a validation step manually or using Record (Record From Here) feature. Using "Record From Here" is probably easier, because Record will automatically add required element to the repository (or select it, if the element is already in repository).

OK, here is how you can validate the text using Record From Here.
  • - At first, make sure the message box in question is already open.
    - Then go to your Recording, right click the last step after which you would like to validate the text and from the context menu select "Record From Here".
    - In the appeared dialog click "Validate" button.
    - Select the text in message box you would like to validate.
    - And finally, follow the steps in Validation dialog, where you should select what should be validated.
    - After finishing the above steps, terminate recording.
That's all. Now you should have a new validation step in your recording. Hope this helps?
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

Ram_Sankar
Posts: 13
Joined: Mon Mar 17, 2014 8:17 am

Re: Message box content - Validation help !

Post by Ram_Sankar » Mon Mar 31, 2014 9:42 am

Hello odklizec,

I cannot thank you enough as this worked. Instead of writing an user code i used the recording option as suggested by yourself.

Thanks a million and you save me every time. 8)

Have a gripping week ahead ! :)

-R

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

Re: Message box content - Validation help !

Post by odklizec » Mon Mar 31, 2014 10:01 am

You are welcome! I'm sure new challenges will follow ;)
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