Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can you use Regular expressions in an OR objects description
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
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")
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Are you trying to log into/activate the application or just needing to modify objects/fields within the application once it is opened?
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
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 ?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
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,
.......
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
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."?
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
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.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
At Regular Expressions for e-mail address ganesh.dengale 6 19,153 08-23-2022, 02:51 PM
Last Post: ahmad3029
  How to disable regular expressions in a text? ttralor 6 6,709 07-05-2013, 02:44 PM
Last Post: Staff
  Need help on using regular expressions on Java Window's title qa_tester 3 5,050 02-13-2012, 10:56 PM
Last Post: madsenfr
  java window titles & regular expressions jotdog2 1 4,211 02-13-2012, 10:55 PM
Last Post: madsenfr
  Process to use Regular Expressions in QTP using screen shots. yvslraotesting@gmail.com 1 3,496 01-31-2012, 12:45 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 2 Guest(s)