Can you use Regular expressions in an OR objects description - 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: Can you use Regular expressions in an OR objects description (/Thread-Can-you-use-Regular-expressions-in-an-OR-objects-description) |
Can you use Regular expressions in an OR objects description - pamandel - 06-29-2009 Hi All, The title of the main window in my application is dynamic so I have been trying to use a regular expression in the the OR's description without any success. To make the problem as simple as possible I created a text file calle - "Testing QTP 95.txt" The description properties in the Object Repository is: text: Testing QTP 95.txt Notepad I have tried to change it to: Testing Q*P 95.txt Notepad and - Testing Q+P 95.txt Notepad and - Testing Q?P 95.txt Notepad None of these work, can anybody explain why, Are you not able to do that? Thanks, Paul RE: Can you use Regular expressions in an OR objects description - XeNoMoRpH - 06-29-2009 I don't believe you can do that. You can either use you Object Repository or Descriptive Programming. The only instance where you can use both is when you start out with the Object Repository and than use Descriptive Programming. Example: Code: Browser("My Browser").Page("title:=Descriptive Programming") RE: Can you use Regular expressions in an OR objects description - Parke - 07-24-2009 Are you trying to log into/activate the application or just needing to modify objects/fields within the application once it is opened? RE: Can you use Regular expressions in an OR objects description - basanth27 - 08-13-2009 If your question is mere regular expressioning a text then there are several patterns which you can use. The simplest one would be like, Testing QTP.* - this will ignore all the charachters after QTP. In other words any window with the title begining as "Testing QTP" will be identified. Was this what you were looking at ? RE: Can you use Regular expressions in an OR objects description - pamandel - 08-13-2009 I would love it if I could do that but the title is so complex that for whatever reason QTP cannot recognize it(or maybe there is another reason for that). The Main Window of my app is identified through regexpwndtitle = "Application 1 Core v4.0 [ 3.022.013C ]. Logged in as 'USER1' QA ENV" There are 3 different places in that name that are variable. Even using regular expressions to do the following is not recognized. "Application 1 Core v4\.0 \[ 3\.022\.013C \]\. Logged in as 'USER1' QA *" Since this is the main window in which all other objects reside in using Descriptive programming is unrealistic. I resolved the problem by getting the object name using the WIN API Function FindWindow to get the current name and then SetTOProperty to name it correctly. That seems to work without problem. Thanks, ....... RE: Can you use Regular expressions in an OR objects description - maddy.brad - 09-16-2009 What is the regular expression for the "Static" object in which text string "Its a page which can not appear OR if it appear than the window size should be 1024X850."? RE: Can you use Regular expressions in an OR objects description - Saket - 09-16-2009 It seems your query is quite different from the original query of this thread. You should open a new thread for your question with more details describing the issue. |