Forum Discussion

amruthraj's avatar
amruthraj
New Contributor
8 years ago
Solved

How to Skip a Line in Test Complete during Execution

is this possible to create a function which takes a string input , if string matches then skip the execution to next line.     ex:- sub Login(userName, password) Aliases.browser.AdminSignIn.Usern...
  • shankar_r's avatar
    shankar_r
    8 years ago

    You are using now,

     

    Aliases.browser.AdminSignIn.Username.SetText  IsSkipped(useName)

    Aliases.browser.AdminSignIn.Password.SetText  password

     

    Instead of this, I would say for entering the field you can create a common function as below.

     

    Function EnterTextBox(ObjectTextBox,ValueToEnter,fridenlyName)
    
    If ObjectTextBox.Exists Then
     
     If ValueToEnter <> "Skip" Then 
       ObjectTextBox.SetText(ValueToEnter)
     Else
       Log.Message(fridenlyName & "textbox skipped")
     End If
    Else
    
     Log.Error(fridenlyName & "Object does't exists")
    
    End If

     

    To implement above just call like below,

    EnterTextBox(Aliases.browser.AdminSignIn.Username,"<valuetoenter>","User Name")