Micro Focus QTP (UFT) Forums
checkbox in gmail - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: checkbox in gmail (/Thread-checkbox-in-gmail)



checkbox in gmail - narayan1975gmail - 11-19-2009

I am practising gmail application to make hands dirty in QTP. In home page there is a checkbox(stay signed in). I need to QTp to do
1. If its already checked-QTP should uncheck
2. If its unchecked- QTP should check


RE: checkbox in gmail - Saket - 11-19-2009

Hi narayan1975gmail,
Have you tried to do this, if not I will suggest you to first try with yourself and let us know if face any issue, we will be more happy to help you.
If tried and having some issues then let us know with proper issue, if required paste your lines of code, snapshots etc.


RE: checkbox in gmail - narayan1975gmail - 11-19-2009

Saket

Code:
browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").webedit("name:=Email").Set "xxxxx"
browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").webedit("name:=Passwd").Setsecure "xxxx"
browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").WebCheckBox("name:=PersistentCookie").GetROProperty("Checked")

Is line 3 is ok....As i was referring, I need QTP to check/uncheck based on its initial status


RE: checkbox in gmail - Saket - 11-19-2009

use this with an If statement like
Code:
If browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").WebCheckBox("name:=PersistentCookie").GetROProperty("Checked") then
    browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").WebCheckBox("name:=PersistentCookie").Set "OFF"
else
    browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").WebCheckBox("name:=PersistentCookie").Set "ON"
end if



RE: checkbox in gmail - narayan1975gmail - 11-19-2009

Thanks Saket!

My next hurdle is after sign on, click Trash link and select ALL check boxes
Code:
browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").webedit("name:=Email").Set "narayan1975"
browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").webedit("name:=Passwd").Setsecure [Moderator : Never disclose your Password - Saket]
If browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").WebCheckBox("name:=PersistentCookie").GetROProperty("Checked") then
    browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").WebCheckBox("name:=PersistentCookie").Set "OFF"
else
    browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").WebCheckBox("name:=PersistentCookie").Set "ON"
end if
browser("name:=Gmail: Email from Google").page("title:=Gmail: Email from Google").webbutton("name:=sign in").click

browser("name:=Gmail - Trash - narayan1975@gmail.com").page

("title:=Gmail - Trash - narayan1975@gmail.com").link("name:=trash").click
browser("name:=Gmail - Trash - narayan1975@gmail.com").page("title:=Gmail - Trash - narayan1975@gmail.com").webelement("outertext:=all").click

I encounter an error in line browser("name:=Gmail - Trash - narayan1975@gmail.com").page("title:=Gmail - Trash - narayan1975@gmail.com").link("name:=trash").click

Cannot find the "[ Link ]" object's parent "[ Browser ]" (class Browser). Verify that parent properties match an object currently displayed in your application.


RE: checkbox in gmail - Saket - 11-19-2009

Hi Narayan,

First of all, never disclose your confidential information publicly.
I have seen there your password in your last post.
Take my advise and do take care of this strongly.

also please maintain one query per thread. create a new thread for your new query.

Thread is closed now