Tuesday, November 18, 2014

TestComplete : UserForms

TestComplete : UserForms





Dim sPath,sBrowser,oDialog,form,mr

sub a
    Set form = UserForms.UserForm1
    Set oDialog = form.OpenDialog1        
     
      do
        mr=form.ShowModal     'Show GUI
        Select Case mr
            Case mrOK          'Ok button , In properties set the ModalResult as mrOK 
           
                   if( (form.cxRadioGroup1.ItemIndex=0 or form.cxRadioGroup1.ItemIndex=1) and sPath<>"" )then
                      if(form.cxRadioGroup1.ItemIndex=0) then
                        sBrowser="FireFox"
                        else
                        sBrowser="IE"
                      end if   
                      exit do
                   end if
                             
            Case mrCancel     'Cancel Button .'Ok button , In properties set the ModalResult as mrCancel      
                  exit sub
                     
             Case mrYes         'BrowserButton , In properties set the ModalResult as mrYes
                     oDialog.Execute           'Trigger TOpenBrowser
                     sPath=oDialog.FileName
                     form.Path.Text=sPath
      End Select
    Loop  While (1<2)
   
    msgbox("Browser="&sBrowser&vblf&"File Path="&sPath)
     
end sub

1 comment:

  1. Hi,

    Very elaborated and useful information,thank you

    https://tekslate.com/

    ReplyDelete