简体   繁体   中英

how do I access Chrome Developer Console from Selenium

I'm trying to use the chrome web developer tool javascript console function performance.timing.domComplete within an automated test using something like this:

driver.ExecuteScript("performance.timing.domComplete"));

I'm using C# , Webdriver and Chrome

I think maybe one of these timing values could be used for a Wait function or monitoring performance within a test.

I'm not real clear on what your question is, but if you are looking for a way to do Waits with WebDriver, take a look at the Webinator project (available on nuget), it has a lot of wait options like:

Web.Click(LocateBy.Id("submitForm"), WaitUntil.AjaxOrPostCompleted());
Web.Click(LocateBy.Name("addClient"), DelayUntil.Displayed(LocateBy.Id("someId")));

If you are wanting to roll your own, you will likely need to inject javascript that detects the onbeforeunload and ready events and notifies WebDriver accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM