Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to delete particular mails in Gmail using QTP
#1
Solved: 10 Years, 1 Month, 2 Weeks ago
Hi, Need a script to delete particular mails from gmail using QTP.
Im using QTP 10, IE7.

Sample code: But it is not working properly. Thanks in advance.

Code:
For i = 1 to 10
A = Browser("Inbox.*").Page("Inbox.*").WebTable("Click to teach Gmail this").GetCellData(i,5)
Expected = " me"
Actual = Split(A,",")
'Print Actual(1)
If Expected = Actual(1) Then
'print "Passed"
Set B = Browser("Inbox.*").Page("Inbox.*").WebTable("Click to teach Gmail this").ChildItem(i,1,"WebElement",0)
B.Set "ON"
'Browser("Inbox.*").Page("Inbox.*").webelement("micclass:=WebElement","class:=T-Jo-auh","height:=15","index:=0").click
'Browser("Inbox.*").Page("Inbox.*").webelement("class:=T-Jo-auh","index:=1").click
Else
print "Failed"
End If
Next
Reply
#2
Solved: 10 Years, 1 Month, 2 Weeks ago
The below code is working perfectly.
Code:
Expected = "Raj"
For i=0 to 10
    Actual  = Browser("Browser").Page("Page").WebTable("WebTable").GetCellData(i,5)
    ActualSplit = Split(Actual,", ")
    'print Actualsplit(0)
    If Expected = Actualsplit(0) Then
        'print "expected=actual"
        Set DP = Description.Create
        DP("micclass").Value = "WebElement"
        DP("class").Value ="T-Jo-auh"
        DP("html tag").Value = "DIV"
        Set DPChkBox = Browser("Browser").Page("Page").childobjects(DP)
        With DPChkBox            
            print DPChkBox.Count
            DPChkBox(i).Click
        End With
        Set Mouse = CreateObject("Mercury.DeviceReplay")
        x=Browser("Browser").Page("Page").WebElement("Delete").GetROProperty("abs_x")
        y=Browser("Browser").Page("Page").WebElement("Delete").GetROProperty("abs_y")
        Mouse.MouseMove x+5,y+5
        Mouse.MouseClick x+5,y+5,LEFT_MOUSE_BUTTON
    Else
        print "expected<>actual"
    End If
Next
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete Firefox history and Cookies Anupama 0 1,426 06-18-2018, 11:57 AM
Last Post: Anupama
  How to delete the cookies (1000 records) akhandesh 1 2,724 09-03-2014, 09:57 AM
Last Post: vinod123
  Delete Gmail email newqtp 4 4,746 07-05-2013, 02:12 PM
Last Post: Staff
  Total no of mail in gmail excellentpawan 2 3,146 07-05-2013, 01:56 PM
Last Post: Staff
  gmail signout dropdown thru DP zakshah.12 0 2,305 03-05-2013, 07:47 AM
Last Post: zakshah.12

Forum Jump:


Users browsing this thread: 1 Guest(s)