Answered

Modify IF command to allow based on locators/xpath

Please consider adding a radio button along with the others (TEXT, NUMBER, DATE, IMAGE ) for OBJECT.  Which would then allow us to either select a Locator or enter XPath directly (or both).

This would allow us to have IF logic based on if an object/locator exists or not.

Example:

IF "Pop-Up Box X" Exists  Then

Do This

ELSE

Do This

0
2 comments
Avatar
Payam Fard

Dominic,

Thanks for submitting this request. You can try the following steps without the need for a change to the compare method:

  1. Use Get_web_value command with Type of Boolean and the XPath/locator of the element you are looking to check its existence. This will return "true" or "false" based on whether the element exists or not.
  2. Now, you can use the variable resulting from the above command in your IF statement for the purpose mentioned above.

 

Here is how it would look like:

Get_web_value HALT existence LOCATOR application_page_type_alias BOOLEAN false

If HALT TEXT @existence = true

...

Else HALT

...

End_If HALT

1
Comment actions Permalink
Avatar
Dominic Luminello

Thank you.  I will give this a try.

0
Comment actions Permalink

Please sign in to leave a comment.