GetROProperty("innertext") not working as expected

346 views
Skip to first unread message

Rajeev Bhavsar

unread,
Oct 8, 2010, 6:10:35 PM10/8/10
to qtp-ele...@googlegroups.com
Hello Team:

This is what I am doing for assignment 1
1) Login - Pass
2) Compose email - Pass
3) Click Send - Pass
4) Check message send. - Fails
Trying to get the value from GetROProperty, see attached OR screen shot.
My code:
===========
sSuccMsg = "Your message has been sent."

'ckSuccMsg = Browser("IE
Browse").Page("CM").WebElement("sSuccMsg").GetROProperty("innertext")

var_GetROProperty = Browser("IE
Browse").Page("CM").WebElement("sSuccMsg").GetROProperty("innertext")
=======
Note all the variables are declared in Dim

In the above code it is not able to know what is
GetROProperty("innertext"). So I tried to generate code by the setp
generator.
Same error no success.

Any fresh eye can catch what I am not able to see. Let me know.

Thanks,
-Rajeev

OR.JPG

Karthik QTP

unread,
Oct 8, 2010, 6:43:00 PM10/8/10
to QTP eLearn Team
Rajeev - Try 2 things.

1. Put a wait statement for 5 seconds after you click send. enough for
the new page to load.
2. When you say fail? What does it do? What is the error? Or did you
use if obj.exist method?
>  OR.JPG
> 84KViewDownload

Brinda Rathod

unread,
Oct 12, 2010, 11:43:24 AM10/12/10
to Rajeev Bhavsar, qtp-ele...@googlegroups.com
hi Rajeev,

Try working with default view as "Basic HTML" when working with gmail
application as suggested by Karthik during our training. It will
surely solve your problem.
Let me know if you need script. i do have tried and its working fine.

Regards,
Brinda (A30 batch)

Varija Sirivolu

unread,
Oct 12, 2010, 12:13:51 PM10/12/10
to Brinda Rathod, Rajeev Bhavsar, qtp-ele...@googlegroups.com
Hi Brinda,
 
I too have the same problem!  Iam using QTP 11 and it is not recognising the Compose mail from object repository. And where i have to select the default view as "Basic HTML" ? Can you please send the script?
 
Thanks,
Varija

Brinda Rathod

unread,
Oct 12, 2010, 12:21:03 PM10/12/10
to Varija Sirivolu, Rajeev Bhavsar, qtp-ele...@googlegroups.com
Hi Varija,

Have attached a picture where you can find "Basic Html" link. Note: you will see once you are already logged in your gmail account.

Find the script as below. Have used DP. 

'2 Login to appl
set myb = browser("title:=.*").page("title:=.*")

Set mywebedit = description.Create()
mywebedit("html tag").value = "INPUT"
mywebedit("name").value = "Email"

myb.webedit(mywebedit).set "abcd" 'Enter Username

mywebedit("name").value = "Passwd"
myb.webedit(mywebedit).set "***********" 'Enter Password

'click sign in button
Set mybt = description.Create()
mybt("name").value = "Sign in"

myb.webbutton(mybt).click

'3 Click Compose mail link (Set the default view as Basic html)
Set myl = description.Create()
'mycom("html tag").value = "DIV"
myl("innertext").value = "Compose mail"
myl("index").value = 0

myb.link(myl).Click

'4 Enter required data
Set mytxt = description.Create()
mytxt("html tag").value = "TEXTAREA"
mytxt("type").value = "textarea"
mytxt("index").value = 0

myb.webedit(mytxt).Set vto

Set mysub = description.Create()
mysub("html tag").value = "INPUT"
mysub("name").value = "subject"

myb.webedit(mysub).Set vsub

'5 Click Send msg
Set mysend = description.Create()
mysend("name").value = "Send"
mysend("index").value = 0

myb.webbutton(mysend).Click

'6 Confirm msg send - Capture text
Set mymsg = description.Create()
mymsg("innertext").value = "Your message has been sent."
mymsg("index").value = 0

mycap = myb.webelement(mymsg).GetROProperty("innertext")
msgbox mycap

Let me know if you need any help further.
Regards,
Brinda
Basic Html view.png

Varija Sirivolu

unread,
Oct 12, 2010, 12:46:10 PM10/12/10
to Brinda Rathod, Rajeev Bhavsar, qtp-ele...@googlegroups.com
Hi Brinda,
Thank you so much!
Actually, iam new to VB programming. The script looks complicated to me. Iam in Manual Testing.
I will try and let you know.
 
Thanks,
Varija

Victor Madu

unread,
Oct 12, 2010, 1:37:12 PM10/12/10
to Rajeev Bhavsar, qtp-ele...@googlegroups.com
hi Rajeev,

I think U have ckSuccMsg and var_GetROProperty as the same thing that
may confuse QTP:

If you declared ckSuccMsg, then try:
Set ckSuccMsg = Browser("IE


> Browse").Page("CM").WebElement("sSuccMsg")

print "Message is " & cKSuccMsg.GetROProperty("innertext")

I hope this helps - and tell me if I'm wrong guys.

Thanks

Victor

On 10/8/10, Rajeev Bhavsar <rbhavs...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages