Dim i=0
sObjExist
=Browser(browser).Page(page).WebTable(table).WebElement(PersonName).Exist(0)
'checking whether Person exist or not and saving into a variable
If
Browser(browser).Page(page).WebTable(table).WebElement(PersonName).Exist(0)Then
msgbox "Pass"
Elseif Not sObjExist Then
Do Until sObjExist=True
i=i+1
Browser(browserName).Page(pageName).Image("Next Page").Click
If
Browser(browserName).Page(pageName).WebTable(table).WebElement(PersonName).Exist(1)
Then
msgbox "Pass"
Exit Do
End if
sObjExist=Browser(browserName).Page(pageName).WebTable(table).WebElement(PersonName).Exist(0)
if i=10 then
Exit do
End if
Loop
Else
Msgbox "Fail"
End If
On Thursday, December 19, 2013 1:58:43 PM UTC+5:30, L V Prasad wrote:
>
> Hi All,
>
> Need help in below scenarios:
>
> I need to find out a person name exist in the available result table, this
> result table might contain 1 to 10 pages.(or more than 10)
>
> I am able to verify the Person name in 1st page
> If person name not exist in 1st page, then I am navigating to second page
> and + 1 + 1....
> when i reach last page and Person not found , my code still navigating to
> next page but technically there is no next page (system displays the last
> page again and again).
>
> this is the code wt im using:
>
> sObjExist
> =Browser(browser).Page(page).WebTable(table).WebElement(PersonName).Exist(0)
> 'checking whether Person exist or not and saving into a variable
>
>
> If
> Browser(browser).Page(page).WebTable(table).WebElement(PersonName).Exist(0)Then
> msgbox "Pass"
> Elseif Not sObjExist Then
> Do Until sObjExist=True
> Browser(browserName).Page(pageName).Image("Next Page").Click
> If
> Browser(browserName).Page(pageName).WebTable(table).WebElement(PersonName).Exist(1)
>
> Then
> msgbox "Pass"
> Exit Do
> End if
>
> sObjExist=Browser(browserName).Page(pageName).WebTable(table).WebElement(PersonName).Exist(0)
> Loop
> Else
> Msgbox "Fail"
> End If
>
> with the above code if the person not exist then still my code clicking on
> next page even there is no next page (last page).
>
> I want to verify the person in 10 pages and if person not exist in 10th
> page also then i want to exit from loop and fail the step.
>
> Could you please guide me possible way.
>
> Thank you,
> L V Prasad. K
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.