Highlighted
Super Contributor.
Super Contributor.
365 views

Set Action to disabled in UFT

How could I set an Action to disabled? I don't want to comment out all the lines all delete it, just to make it "not run".

0 Likes
5 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: Set Action to disabled in UFT

I usually wrap the code in a Sub, something like

Sub Dummy()

Action code here

End Sub

Mark Smith.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Set Action to disabled in UFT

I see, but it is not a solution, when Action contains syntax errors, code snippets.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: Set Action to disabled in UFT

There's no straightforward solution but you can have a workaround like this.

SkipAction = "Action2"

Define a variable SkipAction  & set the name of the action that you want to skip, elsewhere in the Test.

In the Action, you should have the following code at the start.

If Environment("ActionName") = SkipAction Then
 ExitAction
End If

' Rest of your code.

_____________________
Rajkumar Rajangam
Highlighted
Super Contributor.
Super Contributor.

Re: Set Action to disabled in UFT

I see, but UFT will find syntax errors during compilation of project, so it will not be excuted.

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: Set Action to disabled in UFT

The only other way you might be able to do it is manually editing the script file in the Action0 folder and commneting out the call to the action, something like:

RunAction "Action1", oneIteration
 ' This call is commented  out'
'RunAction "Action2", oneIteration
RunAction "Action3", oneIteration

Mark Smith.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.