-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
switchToPage is deprecated. What should i use instead? #2131
Comments
Same with me, i couldn't finde any reference on Internet |
It looks like people are still using this method so I will un-deprecate it :-). |
@wakaleo Thanks a lot :) |
Has this been fixed? Seems like this is still an issue on version 2.3.4. I have also checked this on version 2.3.12 and seems to be broken on this version too. I seem to be getting a NullPointerException when this is used: java.lang.NullPointerException |
No fix because it's intended to be deprecated. |
Okay, but then the original question stands:) What should we use instead? |
You don't need to use anything. Just use the page object (or locators) you want to use. What problem are you trying to solve? |
Right, I thought that may be the that. Okay, thanks :) |
@wakaleo : I am using this as a workaround ! |
You can do that. But why do you need to return anything at all? Why not just use the page you expect to be displayed, rather than trying to bind your code to the structure of the application UI? |
with you on that !! I just thought that some people were looking for solution ! Had one so put it here !! Its gets stuck here for a long period of time and eventually i have to stop the jenkins run ! webdriver.driver=chrome #serenity.driver.capabilities = And Serenity.conf looks like this : Unable to find where is the gap !! Can you please help @wakaleo ? |
Hello, Thanks for your help |
Modeling navigation in your tests is a bit of an anti-pattern - what if you go to a different page? Just use the page that you expect to be visible. |
Hello, First of all, thanks for your reply. We are aligned with the fact that it's probably risky (with lik your test with sut). But in some case to validate behavior we need to go through more than one page object (more than one url). In this case, what is the best practice (and have you some examples). thanks, |
Just because you need to navigate through page objects doesn't mean your test automation code needs to hard-code this navigation. Consider the following steps (using the Action Classes pattern:
Each method will then access the UI elements it needs to do its job. You can group related UI locators into classes and call these Page Objects if you like. But you don't need to hard-code any navigation logic in your test code. For example:
|
hello, Thanks for you answer and your help. |
Hi, i just decided to migrate from old Serenity-BDD version to new one. I found that
switchToPage
is deprecated. What should i use instead?I also have a little proposal: could you create a comments with migration advises from deprecated methods in future?
Thanks. Have a nice day.
The text was updated successfully, but these errors were encountered: