cancel
Showing results for 
Search instead for 
Did you mean: 

gotostepbyname does not seem to work in forward progress

SOLVED
Highlighted
Frequent Contributor

gotostepbyname does not seem to work in forward progress

Hello,

I often use testRunner.gotoStepByName to handle conditional workflow in my project.

So far it was to loop backwards in my testcase, as I try to use it to jump forward to a next step it does not seem to work.

Here the test layout

- step to get a 'type' information :

switch (item_type)
{
	case "a":
	case "b":
		testRunner.gotoStepByName("next_step")
	break;
	default:
		log.warn "\"$item_type\" not processed"
		testRunner.gotoStepByName("last_step")
	break;
}

When I run my first groovy step it shows the warning and the jump to the last step

If I run the testCase, it shows the warning but it goes through the intermediate steps (next_step and after) !

Can anyone help me to understand what I've done wrong ?

 

thank you

 

Alex

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Contributor

Re: gotostepbyname does not seem to work in forward progress

Hi, thanks for replying ...

It is weird, it seems to work now.

I can't find out what was wrong  in my initial process ...

 

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: gotostepbyname does not seem to work in forward progress

Hey Alex,

 

Can you please use this code so I can understand what happens?

 

switch (item_type)
{
	case "a":
break case "b": log.info("item_type equals b") break default: log.info("item_type wasn't equal to any case") break }

 What is it logged when running the test case now?



If my answer helped please click on the 'Accept as Solution' button.
Highlighted
Community Manager

Re: gotostepbyname does not seem to work in forward progress

Hi @krogold,

Were you able to identify the cause of the issue?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Frequent Contributor

Re: gotostepbyname does not seem to work in forward progress

Hi, thanks for replying ...

It is weird, it seems to work now.

I can't find out what was wrong  in my initial process ...

 

View solution in original post

Highlighted
Community Manager

Re: gotostepbyname does not seem to work in forward progress

Anyway, it's great to hear that everything is working now!

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Check out this week's challenge!

Create a script to generate an email when an assertion fails for the TechCorner tag!


Scripts created in July:
- A script to change the request body before sending it to the server