I am struggling with this stale-element-exception. Now I had the idea that I could perhaps maximize the logging in order to get a closer look on what's actually happening. I am instantiating the ChromeDriver by using the syntax in which I pass an instance of ChromeDriverService
(for which I had set LogPath
to a file and EnableVerboseLogging
as true.)
However, this "verbose" logging is not really helpful:
[1591200174.654][INFO]: Starting ChromeDriver *.*.*.* (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 57550
[1591200174.654][INFO]: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1591200174.659][SEVERE]: bind() returned an error: Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden. (0x2740)
[1591200174.659][INFO]: listen on IPv6 failed with error ERR_ADDRESS_IN_USE
...and despite the SEVERE-msg (which might indicate "error" to sensitive or unexperienced readers) my tests were actually executed fine. But given that I ran >20 tests, this log is useless. What I would really like to see is a log about the things that happen in the browser: i.e. when calling ChromeDriver.MoveToElement
etc.
Is there a possibility to get such detailed logs - and what do I need to do?
UPDATE: what exactly do I want to log? Well, I'm actually struggling with two things:
"stale element": my code is not changing the page. And basically I do
elem=FindElementByCSSSelector
and thenMoveTo().Build.Perform
. I don't get how an element can become stale between those steps - so I suppose I need some insight into what's happening inside WebDriver/ChromeDriver.2.if I run the same code under MacOS or Linux, it fails when instantiating ChromeDriver. I already found various security issues which I resolved - but now I'm getting "Connection refused" (which I guess relates to the communication between WebDriver/ChromeDriver and the browser - and Google-searches did not help). So I'd like to see some logging of those processes.
Disclaimer: I'm not asking this on Stackoverflow because SO is about problems with actual code - and this question is more about composing that code!