you hae a inbox and got a mail how can you know it is there
or not write script.
Answer / Ravi Singh
To determine if a new email exists in the Inbox using QTP (WinRunner), follow these steps:
1. Navigate to the Inbox page where the emails are displayed (e.g., Outlook Web Access, Gmail).
2. Identify a unique property of the emails, such as Subject, From, or To fields, that will be used for comparison.
3. Use the 'WinWaitActive' function to verify if the Inbox page is active:
```vbnet
WinActivate("Inbox")
```
4. Use the 'DesktopSpy' or 'Object Spy' tool in QTP to identify the object properties of the email list (table, listbox, or grid).
5. Write a script that loops through all emails and compares their unique property values with the expected values. If a new email is found, store its details for further verification or reporting. Here's an example using the Subject field:
```vbnet
Dim CurrentSubject as String
Set objTable = Browser("Microsoft Internet Explorer").Page("Inbox").Child("Table").Child(0) ' Assuming the email table is the first child of the Inbox page
For i = 1 to objTable.RowCount-1 ' Looping through all rows except the header row
Set objEmail = objTable.Row(i).Cell(1) ' Assuming Subject is in the first column (Column 0 indexed as 1)
CurrentSubject = objEmail.Text
If CurrentSubject <> ExpectedSubject then ' ExpectedSubject should be the subject of the last email you checked against, or the expected value for a new email
Print "New Email Found: " & CurrentSubject
' Perform further verification or logging as needed
Exit For
End If
Next i
```
| Is This Answer Correct ? | 0 Yes | 0 No |
what is software metrics
How do you unload the GUI map?
Please give an example for test case.
what is the default mode of executing TSL Script
How do you identify which files are loaded in the gui map?
what is mean by release in quality center and who will perfom?
What is debug mode in Winrunner?
How do you find an object in an gui map.
How do you handle unexpected events and errors?
what is mean by test coverage?
Explain the use of test director software?
Hiiiiiiiii This is lavanya.....At present i m working as a MATLAB developer at CMC(A tata enterprise)from about1 year .now i want to move to testing field as a fresher?Is this possible...can anyone give me a suggestion regarding d testing field.....