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


How to click only unread mails in Gmail using vb script - Anees Khan - 02-07-2008

Thanks in Advance!!

would any one help me in answering or guideing me to this question
how to write a vb script code with QTP to click on the only unread E-mails from gmail or yahoo.


RE: How to click only unread mails in Gmail using vb script - Ankur - 02-08-2008

Again, it would be better if you can come up with the issue you are facing while scripting/recording/running.
We do not encourage giving full solutions as such. The expectation is that user should try to come up with his/her own solution after getting a hint for approaching the problem.


RE: How to click only unread mails in Gmail using vb script - Anees Khan - 02-08-2008

[quote=Ankur]
Again, it would be better if you can come up with the issue you are facing while scripting/recording/running.
We do not encourage giving full solutions as such. The expectation is that user should try to come up with his/her own solution after getting a hint for approaching the problem

Hi Ankur,

Iam not looking for a solution but looking for approach !
how do u write a script or approach to click on only unread mails in gmail.. If you record clicking on unread mails and play it back the Qtp will not recognise the unread mails again so how do u make QTP understand that


RE: How to click only unread mails in Gmail using vb script - Ankur - 02-08-2008

ok...new question sounds better.

The reason why qtp doesnt recognize, if you replay back the recorded script is because the no of emails get changed everytime right?

You can use regular expression on those (changing) numbers.


RE: How to click only unread mails in Gmail using vb script - Anees Khan - 02-08-2008

tnxs Ankur,

Let me try it out!!!


RE: How to click only unread mails in Gmail using vb script - Anees Khan - 02-08-2008

Ankur!

I think these regular expressions are used for check points...but there is a different logic invloved i guess to click onto this unread gmails.i think its not so easy as u r thinking?
did u try it any time anything of this sort.

If yes plz do guide me!!!..........


RE: How to click only unread mails in Gmail using vb script - Anees Khan - 02-08-2008

sorry for the typo!

if u click onto the unread Emails in the Gmail or yahoo....


RE: How to click only unread mails in Gmail using vb script - Ankur - 02-08-2008

2nd Hint: Take a look at regular expression forum and read all threads in it, probably you can find a way to reach your answer.


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

Hi,

I wrote a small piece of code to check unread mails in gmail.
try it.

Code:
Set excel = CreateObject("Excel.Application")
excel.Workbooks.Open("C:\gmail.xls")
Set sheet = excel.Sheets("Sheet1")

Set objLink = Description.Create()
objLink("html tag").value = "A"

Set objSearch = Browser("title:=Gmail.*").Page("title:=Gmail .*").ChildObjects(objLink)
row = 1
For i=35 to 84 'There are many links but mail (subject) link starts from index 35. Presuming that there are 50 mails per page

     str = objSearch(i).getROProperty("innerhtml")

     If instr(1,str ,"<B>",1)>0 Then 'identifies unread mail by checking whether the font is bold
        sheet.cells(row,1) = objSearch(i).getROProperty("innertext") ' Writes the subject of unread emails in excelsheet from row.
        row=row+1
        j=j+1 'Counts total number of unread mails
     End If

Next

excel.ActiveWorkbook.Save
excel.Quit
msgbox "You have " & j &" unread mail(s)"



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

im getting "General run error"
[attachment=1135][attachment=1135]