Micro Focus QTP (UFT) Forums
OR conditions in Description.Create() - 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: OR conditions in Description.Create() (/Thread-OR-conditions-in-Description-Create)



OR conditions in Description.Create() - stevol - 07-21-2008

Hi,
is it possible in some way to define the properties in the description.create with OR conditions? for example:

Code:
Dim descrLink, objLink
Set descrLink = Description.Create()
    descrLink("Class Name").value="Link"
    descrLink("target").value="_top" or descrLink("target").value="_blank"
Set objLink = pag.ChildObjects(descrLink)

If i don't use target as property, i'll extract also links with target = "".
The only way is to use 2 distinct objects with different target?

thanks


RE: OR conditions in Description.Create() - Ankur - 07-22-2008

Please let us know the problem you are facing while implementing code mentioned above.


RE: OR conditions in Description.Create() - stevol - 07-22-2008

Hi Ankur,
I must check if links on a website page point to an existing page or not. My idea is to collect with ChilObject all links, then click them and capture the final url. I see (thanks to another thread with you) that there are links with target property = "_top" and with target property = "_blank", but also with target property = "" (not valorized).
I wanted to know how create a unique collection of links with target property = "_top" or "_blank", but not = "".
Obviously the code i reported is wrong... but if i don't define the target property, my objLink will contain also links with target property not valorized.
The problem is not blocking, i can always create 2 distinct objects (one "_top", one "_blank"), but i was interested on the idea to define objects with more than 1 acceptable values for a property.. or similarly with a property with all values except someone [for ex. descrLink("target").value <> "" ]... is it possible?

thanks a lot


RE: OR conditions in Description.Create() - surya_7mar - 07-30-2008

Code:
descrLink("target").value="_top|_blank"



RE: OR conditions in Description.Create() - surya_7mar - 07-30-2008

this will get only the links with either _top or _blank in that target property


RE: OR conditions in Description.Create() - stevol - 08-05-2008

great!!

thanks