Blog

Using If and While Group Actions to automate and simplify your workflow

by Graham Downs

The DWS Dimension SwifTest application is a powerful tool to automate your testing on the JD Edwards EnterpriseOne platform. You probably already know how you can create tests with group actions to do just about anything you could imagine.

Now, with If and While Group Actions, you can go even deeper, crafting complex scenarios based on the state of runtime datastore items or other conditions like the current date and time.

Perhaps you’d build up a test that connects to a different E1 environment (development or production) based on certain conditions, and then performs certain actions depending on which environment you’re connecting to.

Or you could set up a test that checked to see if a particular batch had been posted yet, and if it hadn’t, post it.

From a customer point of view, the new Group Actions feature which utilizes If and While statements really enhances the usability of SwifTest. According to Jennifer DiMartino, QA Analyst, Wilbur-Ellis:

“The new Group Actions functionality adds much more versatility to the scripting process, and the change of the naming conventions, to allow for longer variable names, makes the user experience more intuitive. These latest enhancements really speed up the process of testing.”

If Test Example

Here’s an example of a test that does just that. Consider the following:

This test logs into E1 and opens the specified application. Then it finds the batch matching the value in the runtime datastore (stored as part of a previous test). Then it stores the status of that batch in another runtime datastore item.

Now, we want to check if the batch has been posted (Has a status of “D”), and if it has not, then post it.

So, we need an “If” action. Click “Add Action”, choose “Group”, and set the Group Type to If:

This tells SwifTest that the actions inside this group should only be executed if the previously saved batch status is not equal to “D”.

Now, click the Back button to return to the actions list, then click the “+” sign on the grid, to the right of the If group you just added.

Proceed to add all the actions necessary to post the batch, and then click Back. Your test will now look something like this:

Click the Add Action button and proceed to add the rest of the actions in your test (for example, closing down the application and logging out of E1).

While Test Example

And you’re not just limited to executing things based on certain conditions. How about executing a set of actions for as long as a certain condition is true?

For example, you could run a block of actions for as long as a certain value coming from E1 is less than a particular number, knowing that the actions you’re performing are constantly changing that value.

If you’re not technically inclined, this might seem a bit complicated at first. Here’s an example: suppose you want to find a particular batch, and then wait until that batch has been posted (i.e. it has a status of “D”) before continuing.

Here’s how you’d go about it:

The first five steps are identical to the If example above. It logs into E1 and opens the specified application. Then it finds the batch matching the value in the runtime datastore (stored as part of a previous test). Then it stores the status of that batch in another runtime datastore item.

Now, we want to wait until the batch has been posted (Has a status of “D”), so we need a “While” action. Click Add Action, choose “Group”, and set the Group Type to While:

You’ll notice that the parameters for this action are similar to the ones specified in the If group above. But where that action told Swiftest to only run the actions under the group if the batch hadn’t been posted, this one says it should do that, and also repeat the actions under the group for as long as that’s true (up to a maximum of 99 iterations).

Now, click the Back button to return to the actions list, then click the “+” sign on the grid, to the right of the If group you just added.

Add actions to pause the test for fifteen seconds, then find the batch again, and then store the batch status over the one in the runtime datastore. Click the Back button to return to the actions list. Your test should look something like this:

Click the Add Action button and proceed to add the rest of the actions in your test (for example, closing down the application and logging out of E1).

These are just two examples of what you can do with the new Group Actions in DWS Dimension Swiftest. Depending on your level of technical skill, you can get even more advanced.

Have you found an interesting, time-saving use for Group Actions and If and While statements? We’d love to hear from you!

Contact our team today to discuss your requirements.

Stay up to date with the latest news and opinions from DWS.
Subscribe now to our quarterly DIMENSION NEWSLETTER.

DWS Logigear Logo
DWSLogo 257 x 191