java - How do I access Selenium WebDriver's (DOM) representation of a page in a debugger? -
I've just joined a team which uses Selenium WebDriver (with Java), and I was wondering if it represents an object (for example) a DOM model) in the memory of the current page Can I see in a debugger?
At the moment, I get a lot of errors, which can not find the web device I'm looking for, and I thought it might be able to see "click through" to see that In fact, the element (element) is aware of it, however, the WebDriver-related examples that I investigated did not contain any page-specific information.
Of course, is WebDriver present in the memory of a page's content? Which class of example I am looking for?
resolve
terminate your selenium script formally without closing the browser (Do not call The DOM has no representation in Selenium on the client side. Client side is your selenium script. Of course, is there any type of representation of content in a page's memory in WebDrive? No. Which class examples I see? The way A representation of the DOM on the customer side A) Costly, b) Weird, B) Limited, D) All the above. So, what do you do? Use developer tools in the browser. I have found that Selenium does not like to open this device, while it is under control when I tried, it was a while, but when I tried Selenium automatically opened the Developer Tools Can stop. I will open them, and it will close them, I open, it stops, I open, it closes, Selenium works on it to terminate its script to close the browser without saying it. quit () or do something like
quit () ). This is how the browser stays around and you can open Developer Tools to inspect the DOM.
Explanation
WebDriver works on a small server sends the wire command that lives inside the browser you are testing.
WebDriver Customer does not have information about the page that is showing the browser, but when you issue your Selenium command, the server asks for it as necessary, it can remember the identity of those elements, Which are found by you because when you search for an element in the page and the server returns it, then it returns a string that uniquely identifies the element, and this string
W The ebElement object (By the way, this is the reason that you can get
StaleElementReferenceException . If the element that was previously returned, then the browser has been removed by some javascript code, So in your context is the context of the element that is no longer there!) Then when you use the objects and fields of the object, Selenium uses this unique identifier to tell the server what you talk about Talking.
Comments
Post a Comment