Hello guys!
In Part-1 of this post, we discussed about Static DP. Let's look into Dynamic DP in this part.
In Part-1 of this post, we discussed about Static DP. Let's look into Dynamic DP in this part.
Dynamic:
Second way to write DP is by using the Description object. This way also known as Programmatic Description. Description Object also do the same thing as static way do but there are some differences.
- Description Object stores the properties and values of a particular object in an instance of that object. So it become easy to use it in the statement.
- Description Object are used with ChildObjects (very useful method) of QTP.
- It's more useful if you are using multiple properties to identify object. As you will use only instance name in your statement, your code looks more organized.
- It's very handy if you are using index property for object identification (we'll discuss later)
Look into following line. It is DP statement, written by Static approach (as we discussed Part-1 of this post)
Browser(“name:=myBro”).page(“title:=myPage”).webbutton(“name:=Enter”,”type:= Submit”).click
Now let's write the same using Dynamic approach. We see that there are 3 objects in above statement i.e. Browser, Page, webbutton.
Now, first we need to create empty description objects. We'll create 3 object (1 for each object)
Dim oBrowser, oPage, oButton ' declaration is not mandatory but good practice!
Set oBrowser = Description.Create
Set oPage = Description.Create
Set oButton = Description.Create
Now we'll add identification properties & values to these objects.
oBrowser("name").value = "myBro"
oPage("title").value = "myPage"
oButton("name").value = "Enter"
oButton("type").value = "Submit"
oButton("x").value = "301"
And that's it! Our objects are now ready to use now. So, here we go...
Browser(oBrowser).page(oPage).webbutton(oButton).click
As we can see, we will write only the instance name (oButton) instead of all properties and values in statement. If you need to use same object multiple times in your code, your code will not become very lengthy!
Tedious?? I know! :)
Explore the following code to make the things clear...
- Browser("myBro”).page(“myPage”).webbutton(“Enter”).click - OR approach
- Browser(“name:=myBro”).page(“title:=myPage”).webbutton(“name:=Enter”,”type:= Submit”).click - Static DP.
- Browser(oBrowser).page(oPage).webbutton(oButton).click - Dynamic DP
First statement is written using OR approach. For this, objects must be stored in Object Repository.
Second statement is written using Static DP. All the properties are given directly in the code. Convenient!!
Third statement is written using Dynamic DP. You need to create a description for every object.
Please note that any statement can be written by combining all three ways!! Really?? Yesss!
Lets see how...
Browser("myBro").page(“title:=myPage”).webbutton(oButton).click
In above statement, we have used all 3 ways..
Browser - Object Repository
Page - Static DP
webbutton - Dynamic DP
Ohhh I see!!
Only point to take care here is that OR can't be used after DP.
Okey guys.. In next part of post, we'll discuss pros & cons of each way and other good stuff about DP.
In case of any queries, please post your comments.
Nice work..waiting for next post!!
ReplyDeleteIts really a nice post!!!
ReplyDeleteVery helpful information!!! Thanks much.
ReplyDeleteit's a very nice post....thanks ,keep posting
ReplyDeleteit's very nice post... and very helpful. Thanks a lot
ReplyDeletecapturebitmap(fname.bmp), if i use this command and run second time i get error msg that file exists. what is the solution to avoid this and supply another file name dynamically.
ReplyDeleteHi Admin,
ReplyDeleteIts really nice content and very help.
Can you please accommodate my below request.
Can you please post any article in Webtable in QTP, all its methods and examples as you have mentioned in other articles.I hope this suggestion will come soon in post.
Thanks.
Its really gives the difference between OR,Static & Dynamic which really helps to learn.Hope you ppl really giving the best materials.
ReplyDeleteHi Madhu,
ReplyDeleteUse the time stamp for the filename(unique for everytime) then u wont get the error.
Great articles...thanks for sharing
ReplyDeleteuseful information...thanks
ReplyDeleteExcellent Stuff dude!!Got to learn a lot of useful info.Keep Posting abt QTP!!:)
ReplyDeletehi.. i want to know that for login page of gmail also we will go for dyanamic DP or static programming?
ReplyDeletei know how to write static DP.. but have problem in dyanmic DP... if suppose we have so many users data in datatable then hw can i write using dyanamic DR.. pls write here ,,, thanks in adv
I appreciate your work
ReplyDeleteExcellent Stuff.....Got to learn a lot of useful info.Keep Posting abt QTP!!:)
ReplyDeletethank you all!!
ReplyDeleteHi Abhi, Am new to DP. Very nice to see your posts. Your explenation is very good. I want to know, where do you stay ...I want to learn directly from you. so that i can gain the knowledge even better.
DeleteBy reading this blog, you are learning directly with me!! Happy to help if you have any question..
Deletegood post
ReplyDeletevery good clearly explained the things
ReplyDeleteMay god bless you. You are really doing great job!!
ReplyDeletevery clear explaination given.Thank you
ReplyDeleteVery good post..
ReplyDeletevery useful cleared many things....
ReplyDelete@Pawan - thanks! Good to know that you like it.
ReplyDeletegreat post indeed!!Thank you
ReplyDeleteHi,
ReplyDeleteI worked above concept on windows and my code is shown below,
Dim oWindow, oButton ' declaration is not mandatory but good practice!
Set oWindow = Description.Create
Set oButton = Description.Create
oWindow("text ").value = "Login"
oButton("text").value = "OK"
oButton("Class Name").value = "WinButton"
oButton("x").value = "116"
Dialog(oWindow).WinButton(oButton).click
During execution i am getting below mentioned error message,
"Cannot find the "[ WinButton ]" object's parent "[ Dialog ]" (class Dialog). Verify that parent properties match an object currently displayed in your application. "
Please help me where i am going wrong
super se uper
ReplyDeleteI just need one clarification on one thing....
ReplyDeleteCan we use multiple
I just need one clarification on one thing....
ReplyDeleteCan we use multiple I HAVE SOME EXAMPLE OF THE JUSTDIAL SITE
BUT HOW CAN WRITE THE SCRIPT THE DATA IS COPIED IN EXCEL SHEET PLEASE HELP FOR ME
very useful cleared many things.
ReplyDeleteAmazon Web Service Training in Chennai | Salesforce Training in Chennai | VMWare Training in Chennai
Great information about QPT. Thanks for sharing such a helpful information.
ReplyDeleteBest Mobility Services | Austere Technologies
Excellent informative blog, keep for sharing.
ReplyDeleteBest System Integration services | Massil Technologies
Python offers a few convenient GUI libraries. Python is less difficult and less demanding to program than Java and exceptionally suited for Internet programming.
ReplyDeletepopular programming language Hayward
aşk kitapları
ReplyDeleteyoutube abone satın al
cami avizesi
cami avizeleri
avize cami
no deposit bonus forex 2021
takipçi satın al
takipçi satın al
takipçi satın al
takipcialdim.com/tiktok-takipci-satin-al/
instagram beğeni satın al
instagram beğeni satın al
btcturk
tiktok izlenme satın al
sms onay
youtube izlenme satın al
no deposit bonus forex 2021
tiktok jeton hilesi
tiktok beğeni satın al
binance
takipçi satın al
uc satın al
sms onay
sms onay
tiktok takipçi satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
instagram beğeni satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
takipcialdim.com/instagram-begeni-satin-al/
perde modelleri
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
betboo
marsbahis
sultanbet
beğeni satın al
ReplyDeleteinstagram takipçi satın al
ucuz takipçi
takipçi satın al
https://takipcikenti.com
https://ucsatinal.org
instagram takipçi satın al
https://perdemodelleri.org
https://yazanadam.com
instagram takipçi satın al
balon perdeler
petek üstü perde
mutfak tül modelleri
kısa perde modelleri
fon perde modelleri
tül perde modelleri
https://atakanmedya.com
https://fatihmedya.com
https://smmpaketleri.com
https://takipcialdim.com
https://yazanadam.com
yasaklı sitelere giriş
aşk kitapları
yabancı şarkılar
sigorta sorgula
https://cozumlec.com
word indir ücretsiz
tiktok jeton hilesi
rastgele görüntülü sohbet
erkek spor ayakkabı
fitness moves
gym workouts
https://marsbahiscasino.org
http://4mcafee.com
http://paydayloansonlineare.com
www.escortsmate.com
ReplyDeleteescortsmate.com
https://www.escortsmate.com
marsbahis
ReplyDeletebetboo
sultanbet
marsbahis
betboo
sultanbet
tiktok jeton hilesi
ReplyDeletetiktok jeton hilesi
referans kimliği nedir
gate güvenilir mi
tiktok jeton hilesi
paribu
btcturk
bitcoin nasıl alınır
yurtdışı kargo
İnstagram takipçi satın al! İnstagram takipçi sitesi ile takipçi satın al sende sosyal medyada fenomen olmaya bir adım at. Sende hemen instagram takipçi satın almak istiyorsan tıkla:
ReplyDelete1- takipçi satın al
2- takipçi satın al
3- takipçi satın al