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

Easy to disable WebDriver facade during debugging #561

Closed
nbarrett opened this issue Oct 5, 2016 · 2 comments
Closed

Easy to disable WebDriver facade during debugging #561

nbarrett opened this issue Oct 5, 2016 · 2 comments
Labels

Comments

@nbarrett
Copy link
Contributor

nbarrett commented Oct 5, 2016

When refining target selectors on particularly complex pages, I like to stop the test at a debugging breakpoint and then experiment in the IDE REPL with different locators e.g.

Target.the("modal error validation message").locatedBy("#ibm_ccd_dialogs_MessageDialog_0").resolveFor(actor).getText()

However, it's easy to accidentally disable the WebDriverFacade if an incorrect selector is used, which means that even if the correct locator is used afterwards, the REPL command above continues to return an empty string. This is very confusing!

I happened to stumble across this handy command that I can also invoke in the REPL to reset the above condition:

StepEventBus.getEventBus().clearStepFailures()

But to my knowledge that isn't documented anywhere. Am I doing things terribly wrong here, and/or is there an easier way?!

@wakaleo
Copy link
Member

wakaleo commented Oct 5, 2016

StepEventBus.getEventBus().clearStepFailures()

is a Serenity internal method, so not really the sort of thing we put in the user manual, but that would be the best way to do what you are trying to achieve.

@nbarrett
Copy link
Contributor Author

nbarrett commented Oct 5, 2016

Thanks - I guess the confusion arises where WebElementFacade is presented in the user guide as being interchangeable with a WebElement. but if a developer calls methods on one where the selector isn't present, then there are drastic side-effects! It might be worth pointing this out somewhere as users of Serenity kind of have to throw themselves fully into the Serenity API in order to use the product, so end up interacting exclusively with WebElementFacade and WebDriverFacade....

@wakaleo wakaleo closed this as completed Feb 12, 2022
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

2 participants