Problems with URL as Object identifier??? - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Problems with URL as Object identifier??? (/Thread-Problems-with-URL-as-Object-identifier) |
Problems with URL as Object identifier??? - jcraig26 - 10-16-2012 I have two objects that are similar in every way except for the URL. In that case, the object I want to ID is something like: .../Activity/111111/2/Detail.aspx The one I do not want is: .../Activity/111111/1/Detail.aspx I could use the Index, but these objects are in a list that could potentially change either adding or removing objects in front of them. So, the index number would be incorrect. Same can be said for using the Visual relation identifier - All the items like the select button or links to other things are identical and would need to be based on the Index value. I tried using the URL and/or Href. Neither were able with the default. If I add the URL and remove the Index, it cannot find the item any longer. Now, the full url includes the www.website001-test-environment.com/. So, I thought I would try a regular expression: [0-9, a-z, \., \-, \:, \/]*/Activity/1123855/2/Details\.aspx Now, QTP says there are more than one object with the same values. I verified there are no other locations on the site for this link. Did I screw up the regular expression or is there a better property to use? Any suggestions would be appreciated! I am spending too much time one this as it is. RE: Problems with URL as Object identifier??? - anil2u - 02-27-2013 I dont know if it really matters answering now, but you could have simply used the regular expression ^.*/Activity and it would have worked. One thing is like you got to click Ok on the dialog, which asks you if you want to treat the symbols like . as they are but not as regular expressions. |