11-22-2011, 11:51 AM
can u try the below code...
Do
Do let me know if it works.
Regards,
Ankesh
Do
Code:
Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set "XYZ"
Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click
'get the msg from the webpage
'‘this will be the msg which u get after hitting search
'plz update webelement(“”).GetROProperty(“innertext”) accordingly. Spy and see which
'object it is and update the code
strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("ObjectName>").GetROProperty("innertext")
'chk for the message
If strResultMsg ="0 records returned" Then
msgbox"Please procced to build"
Exit Do ' Exit the loop
Elseif strResultMsg=="1 records returned" Then
msgbox"Number Already exists in "
Browser("Browser").Page("Page").Frame("toolbar").Link("Customer Search").Click
Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set "XYZ"
Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click
strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("").GetROProperty(“innertext”)
End If
Loop Until strResultMsg="0 records returned"
Do let me know if it works.
Regards,
Ankesh