Micro Focus QTP (UFT) Forums
Delete Gmail email - 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: Delete Gmail email (/Thread-Delete-Gmail-email)



Delete Gmail email - newqtp - 02-13-2013

Code:
If  Browser("name:=.*").page("Title:=.*").webtable("class:=Bs nH iY").Exist   Then
Browser("name:=.*").page("Title:=.*").webelement("Class:= T-I J-J5-Ji nX T-I-ax7 T-I-Js-Gs ar7").Click
End If

this code goes through the successfully but doesn't click the trash icon. I have tried all possible delete method.

Any suggestion..I am going to try from inbox instead of open mail itself. But suggestion for deleting email from open mail is appreciated thanks.


RE: Delete Gmail email - newqtp - 02-15-2013

Here i am trying to delete from inbox 1st email.. But no luck
Code:
With Browser("title:=Gmail.*").Page("micclass:=Page")
    .WebTable("class:=F cf zt").ChildItem(1, 1, "WebCheckBox", 0).Set "ON"
    Setting.WebPackage("ReplayType") = 2
    .WebElement("innertext:=Delete", "index:=0").Click ' gives error here
    Setting.WebPackage("ReplayType") = 1
End With

Any Suggestion will be appreciated.

I have also tried

Code:
If  Browser("name:=Gmail.*").page("Title:=Gmail.*").webtable("class:=Bs nH iY").Exist   Then
Browser("name:=Gmail.*").page("Title:=Gmail.*").webtable("class:=Bs nH iY").Webtable("class:=cf gJ").Image("class:=hA T-I-J3").Click  
' Click delete this message on the fly out
'below line of code doesn't work
'Browser("name:=Gmail.*").page("Title:=Gmail.*").webtable("class:=Bs nH iY").webelement("class:=cj", "outtertext:= Delete this message").Click

End If



RE: Delete Gmail email - newqtp - 02-20-2013

Finally I got it worked, wanted to share so that others don't waste time in looking for solution.

Code:
'delete email
Browser("name:=.*").page("Title:=.*").webelement("height:=29","index:=45").Highlight 'I had to find out the index and it was hit and trial to get the index number
Browser("name:=.*").page("Title:=.*").webelement("height:=29","index:=45").click
Set WShell = CreateObject("WScript.Shell")
WShell.AppActivate "Browser"
WShell.sendkeys("{ENTER}")
Set WShell = Nothing



RE: Delete Gmail email - ursgaurav - 06-03-2013

Here is one more piece of code and it will surely work ,I have tried on IE7,IE8,IE9.There is only one change from the above code i have added the Webelement Class as ar9.* and index:=1.I hope this will help.

Code:
Browser("micclass:=Browser","name:=Your.*").page("Title:=.*").webelement("class:=ar9.*","index:=1").Highlight
Browser("micclass:=Browser","name:=Your.*").page("Title:=.*").webelement("class:=ar9.*","index:=1").click
Set WShell = CreateObject("WScript.Shell")
WShell.AppActivate "Browser"
WShell.sendkeys("{ENTER}")
Set WShell = Nothing



RE: Delete Gmail email - 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.