Selenium Webdriver wait Expected condition failed: waiting for visibility of element located by By.id

As per the Java Docs of WebDriverWait Class if you want to change the Polling Interval you need to change it in the constructor as the constructor is as follows : WebDriverWait(WebDriver driver, long timeOutInSeconds, long sleepInMillis) Wait will ignore instances of NotFoundException that are encountered (thrown) by default in the ‘until’ condition, and immediately … Read more

What is the difference between a CSS selector and XPath? And which is better with respect to performance for cross-browser testing?

CSS selectors perform far better than Xpath and it is well documented in Selenium community. Here are some reasons, Xpath engines are different in each browser, hence make them inconsistent IE does not have a native xpath engine, therefore selenium injects its own xpath engine for compatibility of its API. Hence we lose the advantage … Read more

Textbox events?

Welcome to SO. There are different option to get the associated events. Let’s take the stackoverflow search box (the one which is on the top with s-input js-search-field class) 1) Using getEventListeners Go to chrome console in the dev tools and then use getEventListeners(element). getEventListeners(document.querySelector(‘.s-input.js-search-field ‘)) 2) Using Dev Tools Event Listner Go to chrome … Read more

How do you click on a checkbox from a list of checkboxes via Selenium/Webdriver in Java?

If you already know the id of the checkbox, you can use this method to click select it: string checkboxXPath = “//input[contains(@id, ‘lstCategory_0′)]” IWebElement elementToClick = driver.FindElement(By.XPath(checkboxXPath)); elementToClick.Click(); Assuming that you have several checkboxes on the page with similar ids, you may need to change ‘lstCategory_0’ to something more specific. This is written in C#, … Read more

Difference of Headless browsers for automation

Browser A Browser is an application program that provides a way to look at and interact with all the information on the World Wide Web. Technically a Browser, alternatively referred as a Web Browser or Internet Browser, is a client program that uses HTTP (Hypertext Transfer Protocol) to make requests of Web servers throughout the … Read more

Cannot get automation extension from timeout: Timed out receiving message from renderer

We were seeing something similar with Chrome and the issue came down to the way we were maximizing the browser before running the tests. We switched from this: Driver.Manage().Window.Maximize(); To this (for Chrome only): if (typeof(TWebDriver) == typeof(ChromeDriver)) { var options = new ChromeOptions(); options.AddArgument(“start-maximized”); driver = new ChromeDriver(driverPath, options); }

How do I enable WebGL in headless chrome in Ubuntu?

This worked for me to get chrome to use osmesa sudo apt-get install libosmesa sudo ln -s /usr/lib/x86_64-linux-gnu/libOSMesa.so.6 /opt/google/chrome/libosmesa.so google-chrome –no-first-run –user-data-dir=~/chrome-stuff –use-gl=osmesa Warning: When running with osmesa the entire page is rendered with osmesa making it pretty slow. So, if there are tests you have that can run without WebGL you probably want to … Read more