Micro Focus QTP (UFT) Forums

Full Version: Total no of mail in gmail
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
Please ensure to include your code between [code] tags while asking or replying to questions. I have done this for you for this time.