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.
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