page-load-time

Is the “async” attribute/property useful if a script is dynamically added to the DOM?

不打扰是莪最后的温柔 提交于 2019-11-26 09:27:10
问题 This question is sort of a tangent to Which browsers support <script async="async" />?. I\'ve seen a few scripts lately that do something like this: var s = document.createElement(\'script\'); s.type = \'text/javascript\'; s.async = true; s.src = \'http://www.example.com/script.js\'; document.getElementsByTagName(\'head\')[0].appendChild(s); This is a common way to add a script to the DOM dynamically, which, IIRC from Steve Souders\'s book \"Even Faster Web Sites,\" prompts all modern

How to properly configure Implicit / Explicit Waits and pageLoadTimeout through Selenium?

一个人想着一个人 提交于 2019-11-26 08:38:06
问题 I currently have the following setup, but I\'m not sure that my waits (Implicit and pageLoadTimeout) are working. Is this the proper implementation? By putting it in the @Before(\"@setup\"), does it work for every Scenario or Step Definition run? Will the driver wait accordingly, everytime I call a @Given, @When..etc? @Before(\"@setup\") public void setUp() { driver.manage().deleteAllCookies(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.manage().timeouts()