Skip to content

Handle using go_back() after a URL redirect #1712

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

Closed
mdmintz opened this issue Jan 28, 2023 · 1 comment · Fixed by #1714
Closed

Handle using go_back() after a URL redirect #1712

mdmintz opened this issue Jan 28, 2023 · 1 comment · Fixed by #1714
Assignees
Labels
enhancement Making things better SeleniumBase 4 SeleniumBase 4

Comments

@mdmintz
Copy link
Member

mdmintz commented Jan 28, 2023

Handle using go_back() after a URL redirect

Let's say you're on Website A, and you click a button that takes you to Website B, which immediately redirects you to Website C. A regular Back action, self.go_back(), would take you to Website B, which might immediately redirect you back to Website C again, which is probably not what the user wanted. In this special case, self.go_back() should take you to Website A. (2 Back actions).

In summary: If self.go_back(), (which calls self.driver.back()), doesn't change the current URL, then call self.driver.back() one more time. That should solve the odd case I've encountered.

@mdmintz mdmintz added enhancement Making things better SeleniumBase 4 SeleniumBase 4 labels Jan 28, 2023
@mdmintz mdmintz self-assigned this Jan 28, 2023
@mdmintz mdmintz changed the title Handle using go_back() after a URL redirect (for Recorder-generated tests) Handle using go_back() after a URL redirect Jan 29, 2023
@mdmintz
Copy link
Member Author

mdmintz commented Jan 29, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making things better SeleniumBase 4 SeleniumBase 4
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant