Problem with web elements

107 views
Skip to first unread message

shashi qa

unread,
Dec 7, 2011, 3:52:12 AM12/7/11
to mercu...@googlegroups.com
Hi .
Can any one help me.
I have a page where they are some fields ex name. and a preview button.
where all the field that are filled in the first page will appear. where I want to test whether all the fields that I have filled are appearing correctly in preview page or not.
First I am recording all the fields. Then I am verify the values .For time it is working fine.
But if i parameterize then it is not working

In the preview page the fields are appearing as web elements and the property for the web element  in the Object repositories  are stored as it appeared for the first one instance(In my case as titan).
I am unable to parametrice this as it is showing an error message.

Can any one help me solve this



Rem    This is first page
browser("xxxx").Page("xxxxx |").WebList("product").Select "Titan"
X = browser("xxx").Page("xxxxx |").WebList("product").GetROProperty("selection")
Browser("xxx").Page("xxxxxx |").WebButton("Next").Click


Rem   This is in preview page
y = browser("Sxxxxxx").Page("xxxxxxxx_3").WebElement("Titan").GetROProperty(("Innerhtml"))

rem to check whethere the give input for the product is displayed in the preview page

If x = y Then
msgbox "it is working fine"
else
msgbox "it is not working"
End If


--
Regards

Shashidhar

Shalabh Dixit

unread,
Dec 7, 2011, 5:26:40 AM12/7/11
to mercu...@googlegroups.com
Send the link of your application.... it's not possible to say anything here... I'll give a try and let's see what happens...


Regards
Shalabh Dixit
My QTP Blog



--
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

suman ch

unread,
Dec 7, 2011, 5:38:02 AM12/7/11
to mercu...@googlegroups.com
Hi,

Why r u taking the innerhtml property for the webelement, instead u can take property like "text" or something which actually returns the proper text like "titan", in your case.

And with your code wht's the value of x and y its displaying.

Regards,
Suman Ch

Shalabh Dixit

unread,
Dec 7, 2011, 7:29:19 AM12/7/11
to shashi qa, QTP - HP Quick Test Professional - Automated Software Testing
Attached is the script for you. I have parametrized & validated the following 2 fields (given on the page - http://www.sonosite.com/contact/technical-inquiry)

1. Product
2. Product Serial Number

Test Execution Results attached for more reference.

Also I have used basic checkpoints concept for this. We can also validate these things using other webList & webelement properties.


Regards
Shalabh Dixit
My QTP Blog



On Wed, Dec 7, 2011 at 5:01 PM, shashi qa <shash...@gmail.com> wrote:
Shalabh,
Just want to check the give input in the 1 and 2 contact tech support page is displayed in the preview page 
EX : take and example I have selected product as "Titan" and whether that "titan" is displayed in the privew page but the script should execute when i am supplying multipule inputs from data table .that is I am perameterising the whole scenario.



Regards
Shashi

On Wed, Dec 7, 2011 at 4:53 PM, Shalabh Dixit <shalab...@gmail.com> wrote:
what's the testcase / steps you have to perform.?



Regards
Shalabh Dixit
My QTP Blog



On Wed, Dec 7, 2011 at 4:06 PM, shashi qa <shash...@gmail.com> wrote:
Its http://www.sonosite.com/contact/technical-inquiry 


On Wed, Dec 7, 2011 at 3:56 PM, Shalabh Dixit <shalab...@gmail.com> wrote:



--



Validate_Preview_Page_Contents.zip
Test_Execution_Results_Validate_Preview_Page_Contents.pdf

shashi qa

unread,
Dec 7, 2011, 6:17:40 AM12/7/11
to mercu...@googlegroups.com
For the recorded script it is working fine but if i am parametrise   then object is not identified.



Shashi

shashi qa

unread,
Dec 7, 2011, 8:04:18 AM12/7/11
to Shalabh Dixit, mercu...@googlegroups.com
Shalabh,
This is great And also can you please let me know how I can do it with out using check point..



On Wed, Dec 7, 2011 at 6:16 PM, shashi qa <shash...@gmail.com> wrote:
Thanks..



--


ann hoang

unread,
Dec 7, 2011, 12:13:25 PM12/7/11
to mercu...@googlegroups.com

hi All,
 
Please help me with this problem..
I have 10 window dialogs that were popped up at the same time with same name such as: Window("Test").Dialog("A").Activate
Window("Test").Dialog("A").WinButton("OK").Click
 
but after recorded it and in the Repositories is showed under TestObjects:
Test
      A
 
 
 

ann hoang

unread,
Dec 7, 2011, 12:20:25 PM12/7/11
to mercu...@googlegroups.com
      A_4
      A_5
      A_10
     .A_1
 .......
........
 
how do I modify it to generic so I can click on that ok button in that window. 
 
Notes: problem that every time I want to click on 'ok' in that window so I don't know the number index after underscore is on top first..Thanks
 
Any

Shalabh Dixit

unread,
Dec 7, 2011, 10:44:14 PM12/7/11
to mercu...@googlegroups.com
It is working for parameterized as well. I have sent you the Test Report and the script.
Open the script and see the datatable, you will find 3 set of values.

For without using checkpoint, you can use GetItem method or property selected item value of weblist object.




Regards
Shalabh Dixit
My QTP Blog



shashi qa

unread,
Dec 7, 2011, 11:23:59 PM12/7/11
to mercu...@googlegroups.com
Thanks every one...

Vaishali Chaudhari

unread,
Dec 8, 2011, 9:10:02 AM12/8/11
to annth...@yahoo.com, mercu...@googlegroups.com
Hello Any,
 

This condition can be handle using Descriptive programming and regular expression.

E.g. Window("Text:=Test").Dialog("Text:=A.*").WinButton("Text:=OK").Click

~Vaishali

--

ann hoang

unread,
Dec 8, 2011, 12:11:26 PM12/8/11
to mercu...@googlegroups.com
Hi Vaishali,
 
Thanks for your input.. I did try to use regular expression  but it didn't work. After I record and
In the obj Repositories: that dialog is showed
 
Object Properties:
Name: A_1
Class: Dialog
Repository: Local
 
Test Object details:
Description Properties:
text: A
native class: #32770
is owned window: True
is child window: False
Oridinal Identifier:
Type, Value: Location, 0
 
 
Any

--- On Thu, 12/8/11, Vaishali Chaudhari <vaishalid...@gmail.com> wrote:

Vaishali Chaudhari

unread,
Dec 9, 2011, 5:53:09 AM12/9/11
to mercu...@googlegroups.com, annth...@yahoo.com
use following line. It should work.
E.g.  Window("Text:=Test").Dialog("Name:=A.*").WinButton("Text:=OK").Click
 
Use regular expression for the property which is changing. like here Name.
 
~Vaishali

Parke Kuntz

unread,
Dec 9, 2011, 8:39:39 PM12/9/11
to mercu...@googlegroups.com
Take a look at

http://relevantcodes.com/qtp-working-with-multiple-browser-applications-revised/

Some very good ideas.

http://hpquicktestprofessional.wordpress.com/2010/05/27/working-on-multiple-browser-in-qtp-having-same-object-properties/

Parke

--
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



--
Parke

Srinivas Pavuluru

unread,
Dec 9, 2011, 10:41:22 PM12/9/11
to mercu...@googlegroups.com
Hi
 
Disable smart identification, and add browser name property as name in object identification and re-record the script.  IT should work..  Happy scripting..
 
Thanks
Srinivas

ann hoang

unread,
Dec 9, 2011, 11:14:05 PM12/9/11
to mercu...@googlegroups.com
Thank you very much Parke for the website.
 
Any

--- On Fri, 12/9/11, Parke Kuntz <parke...@gmail.com> wrote:

From: Parke Kuntz <parke...@gmail.com>
Subject: Re: Problem with window name
Reply all
Reply to author
Forward
0 new messages