Micro Focus QTP (UFT) Forums
How to click only unread mails in Gmail using vb script - 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: How to click only unread mails in Gmail using vb script (/Thread-How-to-click-only-unread-mails-in-Gmail-using-vb-script)

Pages: 1 2


RE: How to click only unread mails in Gmail using vb script - RPS_QTP - 09-26-2012

im getting "General run error"


RE: How to click only unread mails in Gmail using vb script - newqtp - 01-21-2013

Hi, I am also on the same boat just want to read only unread email, I can read by passing the subject text but I wan QTP to find unread email and read it, Please help me to think in that direction..

Below code read email by passing text as validation code which is already read by qtp, i can change the text to read unread mail but thats not good approach.

Code:
iRows = Browser("opentitle:=Gmail.*").Page("micclass:=Page").WebTable("class:=F cf zt").GetROProperty("rows") 'get total number rows in webtable
msgbox iRows

' reading email using the cell row text as Validation code
If  Browser("opentitle:=Gmail.*").Page("micclass:=Page").WebTable("class:=F cf zt").Exist   Then
    iRow =  Browser("opentitle:=Gmail.*").Page("micclass:=Page").WebTable("class:=F cf zt").GetRowWithCellText("validation code")
    msgbox "Row number in webtable is " & iRow & " for passed text as validation codefrom email subject"
        With Browser("opentitle:=Gmail.*").Page("micclass:=Page").WebTable("class:=F cf zt")
            Setting.WebPackage("ReplayType") = 2   '2-Runs mouse operations using the mouse
                .ChildItem(iRow, 5, "WebElement", 0).Click
            Setting.WebPackage("ReplayType") = 1 '1-Runs mouse operations using browser events
                Reporter.ReportEvent micPass,"Check Mail","Email is found and read"
            End With
End If