Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to initialize a webdriver when a failure occurs #2228

Closed
Minato20119 opened this issue Sep 12, 2020 · 1 comment
Closed

How to initialize a webdriver when a failure occurs #2228

Minato20119 opened this issue Sep 12, 2020 · 1 comment
Labels

Comments

@Minato20119
Copy link

My problem is as follows: https://stackoverflow.com/questions/63859825/how-can-i-continue-to-run-other-steps-when-there-is-a-failure-using-serenity
I am not sure how to re-create a new webdriver.
With selenium I just need:
Webdriver newDriver = new ChromeDriver();`
Does Serenity allow the initialization of a new webdriver?
Thank you very much!

@globalworming
Copy link
Collaborator

from https://stackoverflow.com/a/63861214/1359903

Reading data from tables usually is a use case for parameterized tests. With cucumber you need to put the data table into the feature file https://webkul.com/blog/parametrization-in-cucumber/

Scenario Outline: Test user Login with different credentials
	Given Open Firefox and navigate to Login page
	When valid "<username>" and "<password>" is entered
	Then User should be logged in successfully
 
Examples:
    | username   | password |
    | rahul@gmail.com | Test@123 |
    | xyz@gmail.com| Testtest |

see https://stackoverflow.com/questions/53193890/cucumber-how-to-read-examples-from-external-excel-file-for-scenarios-outline how to get the data from excel into the feature file.

It seems to me you are not very experienced with the frameworks you use, do you really need them? Maybe I can recommend starting with a simple JUnit Parameterized test? Example: https://www.lambdatest.com/blog/junit-parameterized-test-selenium/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants