Answer the question
In order to leave comments, you need to log in
How to extract the html code of a page from the DefaultElement class?
In a Java project using selenium and maven to manage an html page, I can’t understand why a certain locator is not found under certain conditions. For debugging, I want to get the source html code of the page, save it, so that later I can understand what's going on. I tried using
screen.getDocument().asXML()
where screen is an instance of the DefaultElement class
dom4j.sourceforge.net/dom4j-1.6.1/apidocs/org/dom4...
but judging by the description and what I get, it's not exactly html code, albeit something similar.
Answer the question
In order to leave comments, you need to log in
1. Debug is not an option, put a breakpoint in front of the place where it crashes and manually debug.
2. The locator can again be found with handles in Chrome Dev. tools
3. If you stupidly need the entire html code of the current window, then stupidly output an instance of your webdriver, it will dump the entire DOM for you
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question