Micro Focus QTP (UFT) Forums
Total no of mail 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: Total no of mail in gmail (/Thread-Total-no-of-mail-in-gmail)



Total no of mail in gmail - excellentpawan - 06-17-2013

I want to print total no of mail in gmail and i created following code but this does not add no. of mails of last page

Code:
systemutil.Run "iexplore.exe","gmail.com"
browser("title:=.*").page("title:=.*").webedit("html id:=email","type:=text").Set "usename"
browser("title:=.*").page("title:=.*").webedit("html id:=passwd").Set "password"
browser("title:=.*").page("title:=.*").webbutton("html id:=signIn").Click

Set check = description.Create
check("micclass").value = "WebCheckBox"
set check_count = browser("title:=.*").page("title:=.*").ChildObjects(check)
total = 0
Do   while Browser("IE").Page("Page1").WebElement("Older ›").Exist

         Browser("IE").Page("Page1").WebElement("Older ›").click
                        
         total = total+check_count.count
Loop

print total



RE: Total no of mail in gmail - learnQtptips - 06-18-2013

Verify your condition for the loop. The loop only navigates to the nxt page. And always adds the count that you have captured before the loop. The loop is not capturing the count in every page.

Modify the loop so that it can capture the count in every page and then adds up to the total.


RE: Total no of mail in gmail - Staff - 07-05-2013

Please ensure to include your code between [code] tags while asking or replying to questions. I have done this for you for this time.