Hi
I need to check in the ui whether there is a button by the name of 'Start' or 'Click To Start'
My test module has a click action on the button.
example..
this is the xpath in my app
.../button[@id='btnstart']/form/contextmenu/menuitem[@name='Start']
I need the test to run successfully if the button is having 'Start' or 'Click to start' as text .
How do i do that using ranorex ? is OR condition possible ?
OR condition
Re: OR condition
Sure you can use an Or in your RXPath... Something like the following:
.../button[@id='btnstart']/form/contextmenu/menuitem[@name='Start' or @name='Click to start']
.../button[@id='btnstart']/form/contextmenu/menuitem[@name='Start' or @name='Click to start']
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
-
- Posts: 10
- Joined: Mon Nov 05, 2012 10:27 am
Re: OR condition
Hi Ciege,
Thanks for the help. I have another query.
In my recording module, there is an action that validates using attribute equals. Here It checks if the attribute equals for the specified text.
In my case, the validation should be successfull if the text equals "Welcome" or "Welcome User" .. How can I use the OR condition here ?
Thanks for the help. I have another query.
In my recording module, there is an action that validates using attribute equals. Here It checks if the attribute equals for the specified text.
In my case, the validation should be successfull if the text equals "Welcome" or "Welcome User" .. How can I use the OR condition here ?
You do not have the required permissions to view the files attached to this post.
-
- Posts: 10
- Joined: Mon Nov 05, 2012 10:27 am
Re: OR condition
Hi,
Is there anyway by which I can do this ?
Is there anyway by which I can do this ?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: OR condition
Hello,
You could use the 'AttributeContains' method in order to achieve this as shown below: Note: This method is looking for any values that contains 'Welcome'.
Regards,
Markus (T)
You could use the 'AttributeContains' method in order to achieve this as shown below: Note: This method is looking for any values that contains 'Welcome'.
Regards,
Markus (T)
You do not have the required permissions to view the files attached to this post.
-
- Posts: 10
- Joined: Mon Nov 05, 2012 10:27 am
Re: OR condition
Thanks Markus ..that helped ...
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: OR condition
Just a short follow-up on the topic:
If you want tighter control, which text should validate and which should fail, I'd recommend using the "AttributeRegEx" comparison value. You can then specify a regular expression that defines which text is ok.
Regards,
Alex
Ranorex Team
If you want tighter control, which text should validate and which should fail, I'd recommend using the "AttributeRegEx" comparison value. You can then specify a regular expression that defines which text is ok.
Regards,
Alex
Ranorex Team