For example, the number of email drafts can vary:
QuickTest Professional cannot know in advance which text will be present.
So, how QTP can click such dynamic links?
There are several possible solutions:- We can use QTP Regular Expression to match dynamic link.
- We can use QTP DP (Descriptive Programming) in to find the link during run-time.
- We can use others properties of the dynamic link to identify it
The present QTP video shows first approach.
The tutorial covers the following:
- working with QTP Object Repository
- identification properties of QTP objects
- QTP RegExp in object's properties
- how QTP identifies objects in application
- and others...
QTP RegExp VIDEO - How to click dynamic link?
Dmitry Motevich
30 comments:
Hi,
In this case you have some part of text is fixed and some part is variable...
How do you deal with some text that is completely dynamic.
Which reg expression that matches with country names or a random name?
How to handle such things in QTP?
Shrini
Now you will need to explain what is "\(\d+\)"
:)))
Roman
Do you really think, if you explain to that guy how to solve a problem in details, it will help him?
Roman
2Shrini Kulkarni,
If your links are completely different (for example, they are country names), so you can use others properties to identify Link in Object Repository.
For example, instead of 'text' property you can use 'Index' or 'Location' propties. Or mayby 'href' if possible, and so on. Also, you can select coordinates, but I wouldn't recommend it :)
The idea is simple - you should select something unique to identify the object on Web page.
2Roman,
At least, I think that this video is more useful that the simple answer for all questions - "RTFM" (Read This F**king Manual) :)
Dmitry...Having knowledge is something..but sharing is Divine..Thank you.
SubZero,
Thank you!
I'm glad that you found this video useful.
This does not work if I delete all drafts(zero drafts).does digit d start form 0 or 1
to Anonymous (September 8),
Exactly! It won't work because the regular expression is
Drafts (\d+).
If you want to process all number of Drafts including zero, you can use for example:
Drafts.*
or
(Drafts|Drafts (\d+))
(do not forget to add backslashes)
Hi Shrini,
really its very useful video.
Grate job..
~Chethana
Hi Man,
Really you have done a great job, please continue your service and create more video tutorials in QTP.
Thanks,
Prince3105
hi dmitry,
may be this is simple and silly question..but i need ur help..
can i know the purpose of webtable in this video.
@sweety,
Webtable is a table of emails located in 'Inbox', 'Starred', 'Chats', 'Sent Mail' etc
Its too good
-Jegan
Very good video, helped me a lot
-Vasu
This help me a lot. Thanks a lot for posting this. Sorin
I tried this for Inbox..Can you tell me how to get the count for Read and unread emails.
Hello
When running the scrpit fails at IE pop up box my requirment is it has to clik OK .it works fine some times and fails few times .pls help me out from this.
Hi Dimtry,
You are great buddy :)
reg
bijoy
Hi Dmitry,
Very informative blog. Thanks for all the videos. BTW, how long does it take to make a video. Just curious!!!
Amit
@Anonymous/Amit (February 20, 2009),
Very long :)
I've been working with QTP for a while and the dynamic text was something sticky for these few days, but thanks to your video, it's now solved. Thank you :)
OMO
Nice work
Hi DMitry,
I feel the videos that you have posted should have the fast farward feature.
good job keep it up!!
can u tell me what regular expression i should use for "Inbox(12)" link.And thanku for ur efforts of sharing knowledge excellent way .
Drafts( \(\d+\))?
Hi
thanks for the video. I try to simulate the steps in the video
- upto the point where we rename objects, create the webtable and print the number of messages under Drafts
But in the object property in the frame object, for Name a certain alphanumeric value is set during the first run. During subsequent runs this value seems to be changing, so when I run the script to print the number of messages in Drafts I am getting the following error
Cannot find the "Drafts (1)" object's parent "Fr1" (class Frame). Verify that parent properties match an object currently displayed in your application.
This is my script
Browser("Main").Page("Inbox").Frame("Fr1").Link("Drafts (1)").Click
rowCount=Browser("Main").Page("Inbox").Frame("Fr1").WebTable("Draft").RowCount
MsgBox "Row Count = " &rowCount
Hi
I am a novice trying to learn from your videos. I was trying the scenerio for clicking 'dynamic link'. I created a script following the steps in the video, up to printing the number of messages under Drafts(1). this is how I tested
1. wrote a script to open google mail, clicked on Drafts(1)(have 1 mail under Drafts). My test ends here
2. In the object repository for the frame object, I see a value set for Name.
3. I renamed all the objects, created the webtable, modified script to print the number of entries under Drafts
4. Re-ran the script and I see the error
" Cannot find the "Drafts (1)" object's parent "Fr1" (class Frame). Verify that
parent properties match an object
currently displayed in your application."
I realised each time I run the test, the value for Name in frame changed. This is causing the error.
How do I resolve this? thanks
Cool videos. Just that the speed could be more between steps :)
Hi Dimtry,
Really superb work ,these videos helped me a lot. Keep going :)
Post a Comment