New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Lieutenant Commander
Lieutenant Commander
427 views

"jumping" actions and iterations in UFT

Jump to solution

Hello,

I have a scenario when I have 2 iteration rows in Action 1 and 10 iteration rows in Action 2.

Is it possible to run first iteration in Action 1, then just 5 iterations from Action 2, second iteration from Action 1 and rest 5 iterations from Action 2?

Is it even possible? If so, is there any guidance?

Regards,
Krystian

0 Likes
1 Solution

Accepted Solutions
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

The vartypes may be different which is why the If stmt fails, try:

If Cint(Environment("TestIteration")) = 2 Then
ExitActionIteration
End If

 

Mark Smith.

View solution in original post

0 Likes
10 Replies
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

Add this as your first line in Action1

 

If Environment("TestIteration") = 2 Then

    ExitActionIteration

End If

You then then do simialr in Action2

Mark Smith.

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander
Hello Mark,
I tried this:
If Environment("TestIteration") = 2 Then
ExitActionIteration
End If
MsgBox DataTable("Value", dtLocalSheet)

In localSheet I have a column named "Value" with three lines and this does not work. Do you know why? I have checked settings and Action Call Properties are set "run on all rows".
0 Likes
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

The vartypes may be different which is why the If stmt fails, try:

If Cint(Environment("TestIteration")) = 2 Then
ExitActionIteration
End If

 

Mark Smith.

View solution in original post

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

That is correct Mark. Thank you!

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

Hi @Sperk it works good with

If Cint(Environment("ActionIteration")) = x Then
ExitActionIteration

however test does not go back to action 1 when finished some lines in action 2. Then I want it to go back to action 2 again to finish some lines there. Is it possible?

BR,

Krystian

0 Likes
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

You would probably need to do something like:

DataTable("Action1",dtLocalSheet).SetCurrentRow = x

Mark Smith.

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

Hi,

I think this does not work as in "Action1" should be column name, not action name:

The retrieve DataTable.Value operation failed. The <DD recon> column does not exist. 

0 Likes
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

It should be the local datasheet name for Action1. I just assumed the sheet would be called Action1.

Mark Smith.

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

Hi, exactly, DD recon is name for Action1. So it does not work with local datasheet name for action. UFT suggests there should be column name.

0 Likes
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

Look in the help for 'SetCurrentRow' and 'SetNextRow. These are methods used to manually traverse the datatable rows when you do not just want to process rows 1 to n in order.

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.