cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I do conditional branching in a Synthetics Test ?

Anupam_Kumar
Newcomer

If validation on a certain step fails I can choose an alternate path ?

 

For example - if validation on step 5 fails goto step 17 else goto step 23 or something equivalent to that

5 REPLIES 5

justin_hogue
Dynatrace Advisor
Dynatrace Advisor

Hello,

I haven't tried this myself but you may be able to achieve this by using JavaScript events. Through the use of the JavaScript API you should have the ability to skip execution of events to create a dynamic workflow. I'll provide a link with documentation on this below.


https://www.dynatrace.com/support/help/shortlink/id_brower-clickpath-events#javascript-


Hope this helps!

So I can only skip steps.... and 'skip them forward' ... Any clever way to 'jump back' a few steps ? Are negative numbers allowed as parameters to skip step function ?

Correct, there is no option to jump back to a previous step. 

Synthetic SME and community advocate.

@HannahM,

I have not tried this myself, but might need it in the following weeks. In my case, it's like an IF THEN/ELSE needed to be involved. In each case, 3 steps. So I was imagining to test the result from the site at the end of step 2, and if it's condition A, it would execute steps 3-5, and skip 3 events at the end of step 5. If it's condition B, it would skip 3 events at the end of step 2, executing steps 6-8.

Does this seem feasible in your opinion? If so, it would also solve issues like the one portrayed above, right?

Antonio Sousa

Yes, this scenario is exactly what the skip clickpath events in the javascript event are perfect for. 

Synthetic SME and community advocate.

Featured Posts