![]() |
Troubles with Regex in Browser - 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 Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions) +--- Thread: Troubles with Regex in Browser (/Thread-Troubles-with-Regex-in-Browser) |
Troubles with Regex in Browser - XeNoMoRpH - 06-17-2009 I'm having troubles using regular expressions in general actually and I'm not entirely sure why. Lets say the browser title is ABC. When you go to a different page, it changes to ABC - New Page. I figured I could access the browser with the following: Code: Browser("name:=ABC*") Code: Set bDesc = Description.Create Both should work, but they aren't for me. Does anyone have an idea why? RE: Troubles with Regex in Browser - Ankur - 06-17-2009 While working with description you need to specify whether the property needs to be treated as reg-ex or not... Code: bDesc("name").RegularExpression = True btw... I think by default all properties of description object are treated as reg-ex ,but just in case, let me know if this worked for you. RE: Troubles with Regex in Browser - XeNoMoRpH - 06-18-2009 That also did not work. From my understanding, QTP is supposed to treat the values as regular expressions (as you said). I'm not sure why it's not doing so. RE: Troubles with Regex in Browser - ursvinod - 06-18-2009 Hi Try this Code: Set bDesc = Description.Create or Code: Browser("name:=ABC.*") RE: Troubles with Regex in Browser - XeNoMoRpH - 06-18-2009 That worked. Not sure why I didn't try an actual regular expression. I got to involved with the examples and everyone said you could just use the asterisk. Thanks ![]() |