Re: Descriptive Programming

122 views
Skip to first unread message

Sandeep PL

unread,
Aug 31, 2012, 10:17:38 PM8/31/12
to mercu...@googlegroups.com

Use both depending on the scenarios.
Thanks,
Sandeep

On 01-Sep-2012 3:49 AM, "Kureti Eeswari" <eeswari...@gmail.com> wrote:
Hi All,
 
I am new to QTP ,Pls guide me how we write Descriptive programming in realtime either in first way or in second way.
 
First  way:
 
With Dialog("text:=Login")
    .WinEdit("attached text:=Agent Name:").Set "abcd"
    .WinEdit("attached text:=Password:").Set "mercury"
    .WinButton("text:=OK").Click
End With
 
 
Second way:
 
 
Dim d,a,p
Set d=Description.Create
d("text").value="Login"
Set a=Description.Create
a("attached text").value="Agent Name:"
Set p=Description.Create
p("attached text").Value="Password:"
Set k=Description.Create
k("text").value="OK"
Dialog(d).WinEdit(a).Set "abcd"
Dialog(d).WinEdit(p).Set "mercury"
Dialog(d).WinButton(k).Click
 
 
Thanks All
 
 
 

--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

chaman kalra

unread,
Sep 1, 2012, 12:47:19 AM9/1/12
to mercu...@googlegroups.com
Both methods are fine , You can judge yourself which method to use in which scenerio
--
Thanks & Regards
Chaman Kalra
Email :lucky...@Gmail.Com





avinash vl

unread,
Sep 5, 2012, 3:02:21 AM9/5/12
to mercu...@googlegroups.com

1st one is static descriptive programing and second one is dynamic descriptive programing

Akhalesh Yadav

unread,
Sep 5, 2012, 4:07:36 AM9/5/12
to mercu...@googlegroups.com
Second way is the best approach for this you can reduce the no of errors at run time.

Thanks
Akhalesh
Akhalesh yadav
+919555717928
+919310680659

Rasim Avci

unread,
Sep 5, 2012, 4:43:13 AM9/5/12
to mercu...@googlegroups.com
With with statement you can save from memory and that is reduces
memory risc fail erros during your test runs.

I do not use with et all and I do not use Description object as long
as I do not need it.

2012/9/5, Akhalesh Yadav <akhalesh...@gmail.com>:
Rasim Avcı

george p

unread,
Nov 8, 2013, 9:15:31 PM11/8/13
to mercu...@googlegroups.com
how can i handle WinEdit in Descriptive programing.
I have a web form that repeats WinEdits like

Firstname - Firstname
Lastname - LastName
DOB - DOB...etc

When I object spy, all of them have similar properties..

after I do this I need to parametrize so that it does it multiple times and displays save sucessfuly popup.

any Help is appreciated


george

Ganesh muralidharan

unread,
Nov 8, 2013, 9:23:54 PM11/8/13
to mercuryqtp
You will have to search for unique property of each webedit. It could be index


--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
 
---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Regards,


Ganesh Muralidharan
'God Never Forgets'

george p

unread,
Nov 8, 2013, 10:04:27 PM11/8/13
to mercu...@googlegroups.com

here is the properties for first and  second (repeated) firstname edit boxes:

1.
===
"Class Name:=JavaEdit",
"abs_x:=512",
"abs_y:=271",
"attached text:=1\.",
"background:=white",
"caret_position:=0",
"class description:=edit",
"class_path:=javax\.swing\.JTextField;javax\.swing\.text\.JTextComponent;javax\.swing\.JComponent;java\.awt\.Container;java\.awt\.Component;java\.lang\.Object;",
"developer name:=",
"displayed:=1",
"editable:=1",
"enabled:=1",
"end_selection:=0",
"focused:=0",
"foreground:=black",
"height:=20",
"index:=",
"label:=",
"labeled_containers_path:=",
"logical_location:=",
"path:=JTextField;JPanel;JPanel;JLayeredPane;JRootPane;GuidClientFrameWebstart;",
"start_selection:=0",
"tagname:=1\.",
"text:=",
"to_class:=JavaEdit",
"to_description:=JavaEdit",
"toolkit class:=javax\.swing\.JTextField",
"value:=",
"width:=336",
"x:=431",
"y:=32"

2.
==
"Class Name:=JavaEdit",
"abs_x:=858",
"abs_y:=271",
"attached text:=Please confirm \(re-enter\) the subject's information",
"background:=white",
"caret_position:=0",
"class description:=edit",
"class_path:=javax\.swing\.JTextField;javax\.swing\.text\.JTextComponent;javax\.swing\.JComponent;java\.awt\.Container;java\.awt\.Component;java\.lang\.Object;",
"developer name:=",
"displayed:=1",
"editable:=1",
"enabled:=1",
"end_selection:=0",
"focused:=0",
"foreground:=black",
"height:=20",
"index:=",
"label:=",
"labeled_containers_path:=",
"logical_location:=",
"path:=JTextField;JPanel;JPanel;JLayeredPane;JRootPane;GuidClientFrameWebstart;",
"start_selection:=0",
"tagname:=Please confirm \(re-enter\) the subject's information",
"text:=",
"to_class:=JavaEdit",
"to_description:=JavaEdit",
"toolkit class:=javax\.swing\.JTextField",
"value:=",
"width:=336",
"x:=777",
"y:=32"


It did set name in the first 'firstname" edit box, but the second edit box property is also index=" like first one so dont know what to put:

JavaWindow("title:=Client").JavaEdit("index:=.*").Set "name"

George Popkhadze

unread,
Nov 8, 2013, 10:36:56 PM11/8/13
to mercu...@googlegroups.com
Oh Yes,
I was able to resolve this with index

Thanks once more
God Bless


You received this message because you are subscribed to a topic in the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mercuryqtp/c0C5R-CBEfc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mercuryqtp+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages