cancel
Showing results for 
Search instead for 
Did you mean: 

How to Skip a Line in Test Complete during Execution

SOLVED
amruthraj
New Contributor

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

1 ACCEPTED SOLUTION

Accepted Solutions
shankar_r
Community Hero

Re: How to Skip a Line in Test Complete during Execution

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")


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

View solution in original post

3 REPLIES 3
baxatob
Community Hero

Re: How to Skip a Line in Test Complete during Execution

If I correctly understood you, better to do it within the login function.

 

Pseudo code:

function login(user_name, password):
  
  if user_name:
    Aliases.Username.SetText(user_name)
    Aliases.Password.SetText(password)

  else:
    Aliases.Password.SetText(password)
amruthraj
New Contributor

Re: How to Skip a Line in Test Complete during Execution

 

in our project we have some test where we skip the some of field values, so what i need is  while setting the value , i will call the function , which takes string input, if the given input is "skip", then it should skip the execution to next line ,else it should enter the value to field.

so i can call the same function before setting any values and pass the parameter  value as "skip" if i wanted to skip that field. 

 

currently we are using VB Script for scripting

shankar_r
Community Hero

Re: How to Skip a Line in Test Complete during Execution

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")


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors