Micro Focus QTP (UFT) Forums
How do we use OR operator with Desc Programming. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How do we use OR operator with Desc Programming. (/Thread-How-do-we-use-OR-operator-with-Desc-Programming)



How do we use OR operator with Desc Programming. - anu05446 - 01-05-2014

say I want to count the nos of all the objects on the page which have
html tag = "A" OR innertext="B"
what will be the syntax for the same.
Code:
(Desc("html tag").value="A")  OR (Desc("innertext").value="B") => throws syntax error.

TIA


RE: How do we use OR operator with Desc Programming. - anu05446 - 01-05-2014

any one?? I googled, but could not find out.


RE: How do we use OR operator with Desc Programming. - supputuri - 01-06-2014

Hi Anu,
you have to use regular expresssion - (|) pipe symbol.

Checkout regular expression topic in qtp helper guide.


RE: How do we use OR operator with Desc Programming. - anu05446 - 01-07-2014

thanks for your reply, I know regular expressions but I am not sure how to use it in this case? can you tell me how. ?? I hope you understood the question.
say I want to count the nos of all the objects on the page which have
html tag = "A" OR innertext="B"

one way we can do this is first count the objects individually with html tag = "A" add this count to the objects having innertext="B" now from this total count subtract the objects which have html tag = "A" and innertext="B".