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.Username.SetText IsSkipped(useName)
Aliases.browser.AdminSignIn.Password.SetText password
End Sub
here isSkipped() is a function which takes string as input and If String is ''skip'' then execution will be skipped to next line, without setting the value to user name field
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")