Friday, 3 March 2017

Descriptive Programming for Checkpoint for Webtable

Function Created Using Descriptive Programming for Checkpoint:


Function VerifyTextPresentOnPage(byval objPage, byval Textvalue)
On error resume next

    'Create child object description
    Set childobjdes = Description.Create()
    childobjdes("micclass").value="WebTable"
    childobjdes("html tag").value=".*[A-Za-z0-9].*"
   
    'Create ALL child object    
    set allobj = objpage.ChildObjects(childobjdes)
   
    'get all  web element  outer text from web page and store in output variable    
    For i=1 to allobj.count-1
        output= output & "-" & allobj.Item(i).GetROProperty("outertext")
        print output
       
    Next
   
    'now compare the value if the given value find or not
    If instr(1,lcase(output),lcase(Textvalue)) > 0  Then
        'return true if found
        VerifyTextPresentOnPage= True
    Else
        'return true if  not found
        VerifyTextPresentOnPage= False
    End If
    On Error GoTo 0
End Function

No comments:

Post a Comment

Spring Boot : Exception Handler 14