Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to logout from gmail using QTP
#1
Not Solved
Hi,

My name is Hemant. I just started learning the QTP tool.

Actually I am trying to record a web application.


I just recorded a script for login to the gmail and logout.
I am facing some problems in the below line.

Code:
Browser("Gmail: Email from Google").Page("Gmail - Inbox (28635)").Frame("czecrpgao5tpb").Link("Sign out").Click

Here the value 28635 changes dynamically and the frame "czecrpgao5tpb" name changes dynamically whenever we log on to the gmail.

So these objects are not recognised by QTP and I am not able to log out.

I tried using regular expressions in "Expert View" window pane but it's not working.

How to handle such situations in which the name of the object changes dynamically?

Thanks and Regards,
Hemant Kumar
Reply
#2
Not Solved
Hi,

Go to Object Repository, Select the Page Object & change property value to "Gmail - Inbox.*"
Code:
Browser("Gmail: Email from Google").Page("Gmail - Inbox.*").Frame("czecrpgao5tpb").Link("Sign out").Click
Reply
#3
Not Solved
Hi,

I changed the name property of Page object and changed it to "Gmail - Inbox.*". But the frame name is also changing dynamically. I tried to change the name property of frame object with c.* but I am getting errors. Do I need to change any other property?

Code:
Browser("Gmail: Email from Google").Page("Gmail - Inbox.*").Frame("c.*").Link("Sign out").Click
Reply
#4
Not Solved
Hi sreekanth chilam,
I am also facing the same problem. Looks like you are giving solution in descriptive programming. i tried the following but didn't work.

1. ''The frame name starts with c always(ex framename: c12dferer32dfsf(it changes every time))
Code:
Browser("browserName").Page("Pagename").Frame("c.*").Link("Sign out").click -9999, -9999
2. ''I ignored the frame name as some says it is not neccessary
Code:
Browser("browserName").Page("Pagename").Link("Sign out).click -9999, -9999

poper working code is very much appreciated. I have seen your blog and i appreciate you efforts.

Thanks
krish
Reply
#5
Not Solved
Hi Krish,

By seeing your issue,it seems it's an Object Identification Configuration issue for "Frame" Object class.

So I would suggest you to go with the below way:

Step1: Navigate to Tools > Object Identification > Web > Select "Frame" Object Class and Under Mandatory Properties click "Add/Remove" button then remove "name" property and Add "html id","html tag" properties
Step2: Add the Link(SignOut) object into Object Repository and regularise the browser's name property,Page's title property in Object Repo. and verify by Highlighting the objects once.
Ex: For Browser's name --> "Gmail - Inbox (47) - Kishore" to "Gmail - Inbox .*"
For Page's tiltle--> "Gmail - Inbox (47) - Kishore" to "Gmail - Inbox .*"
Step3: Go to expert view and write the script for clicking the Signout link.
Step4: Execute the script and check it is logging out or not.

Note: Make sure you have chosen required properties for Browser,Page Object classes too in Object Identification window before adding the link object into Object Repo.

I am sure you would be able to logout from Gmail now Smile
Reply
#6
Not Solved
Hi sreekanth,
Thanks you very much for your replay. I followed the steps suggested by you but still the issue has n't been resolved.

In your 3 steps, you said to write the code for clicking on signout. But unfortunately the code fails at this point only. You could have mentioned the code Sad. I have mentioned the code i used to click on signout button(with framename and without frame name).

However i tried the following and it started working. Please let me know if this is the correct way of automating.

Steps:
step 1 and step2 u mentioned are useful
step3: Go to object repository (OR) and select the frame which contains the signout link( The frame name will be shown something like this "c143afasq43"). Add the name property in the object properties by clicking on + sign and selecting the name property.(if name property already exist then ignore adding it).
Step4. Click on name property in the object property and observe the <#> sign. Value configuration properties popup will be displayed. Check the regular expression check box. In the constant text box enter c.* (framename always start with c). Click ok
step5. Now in the expert view , write the code to click on signout link, like below.

Code:
Browser("brwname).Page("pagename).Frame("c143afasq43").link("Sign out").click -9999, -9999
Note that i have given the framename which was captured during recording. But in the object properties we have given it as c.* . So even when the frame name changes the test will pass.

Let me know if this is the correct way to solve this issue.

Thanks
krish
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to delete particular mails in Gmail using QTP rajkumarsm 1 4,181 10-06-2014, 07:03 PM
Last Post: rajkumarsm
Exclamation Login & logout in Siebel and clicking pop-up button yuetling926 7 11,365 07-09-2014, 10:43 PM
Last Post: hhamilton
  Delete Gmail email newqtp 4 4,747 07-05-2013, 02:12 PM
Last Post: Staff
  Total no of mail in gmail excellentpawan 2 3,157 07-05-2013, 01:56 PM
Last Post: Staff
  gmail signout dropdown thru DP zakshah.12 0 2,310 03-05-2013, 07:47 AM
Last Post: zakshah.12

Forum Jump:


Users browsing this thread: 6 Guest(s)