Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OR conditions in Description.Create()
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Please let us know the problem you are facing while implementing code mentioned above.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Code:
descrLink("target").value="_top|_blank"
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
this will get only the links with either _top or _blank in that target property
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
great!!

thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question adding two conditions into a while statement lotos 4 5,072 11-10-2017, 04:49 AM
Last Post: lotos
  How to find out the object property in the Description language . njnirmal 9 6,653 05-19-2015, 12:30 AM
Last Post: qtptester66523
  vb script to stop execution of functions if conditions fail visitjaga 1 7,380 12-05-2013, 12:26 AM
Last Post: ravi.gajul
  Description.Create with same propertie and different values, not working ttralor 2 2,482 01-13-2013, 12:11 AM
Last Post: ttralor
  Error while creating object using description.create object in VB script SarodeGirish 5 6,250 06-19-2012, 05:30 PM
Last Post: ssvali

Forum Jump:


Users browsing this thread: 1 Guest(s)