How to create two scenario such that either of them gets executed depending on the choice of customer made | Selenium Forum
N
nic.nrs Posted on 13/07/2019

Say I want to purchase badminton from online shopping portal. There are two ways - 

1. Go to Sports menu from main menu list and then select as badminton more specific sports looking forward and making an payment.

2. Purchasing can be done at the home page itself so I selected it from home page/dashboard page into my cart and make a purchasing.

 

How is it feasible that either of above scenario is called/executed depending upon customer choice made in cucumber selenium java? Please suggest some logic.


A
Ashish Thakur Replied on 17/07/2019

You can create two different test cases regarding this.


N
nic.nrs Replied on 19/07/2019

There are no test cases concept in cucumber. It's scenario. I am asking how scenario can be created in above case? One more instance, usually it happens users add the product in their cart then proceed to payment, just before that, they are asked to login - this is one way. The other way, users logs in first and then add the product into cart and then proceed to payment.


A
Ashish Thakur Replied on 22/07/2019

You can write two different scenarios for this. Then configure your cucumber options to run either scenario.