Tuesday, December 11, 2012

CRM Click WebButton

Given below code will work for the clicking for CRM WebButton .

Public Sub CRM_Click_WebButton(obj_container, str_WebButtonID)
 Dim i
 Dim j,m
 Dim objs
                'gets all Links from container
              Set objs = obj_container.Object.documentElement.GetElementsByTagName("BUTTON")
    'for each object - check if the expected link is found
                For j = 0 to objs.length - 1
     If Instr (1,objs(j).id,str_WebButtonID,1)>0Then
      objs(j).Click
     End If                   
                  Exit for
    Next
       End Sub

2 comments:

  1. Thanks a lot for your explanations. It helped me a great deal at work to resolve a problem I faced recently.

    ReplyDelete
  2. Hi sap testing tools..Thanks for commenting.Glad to know that it found it useful.

    ReplyDelete