Tests fail immediately with unknown error: DevToolsActivePort file doesn’t exist when running Selenium grid through systemd

Thumb rule A common cause for Chrome to crash during startup is running Chrome as root user (administrator) on Linux. While it is possible to work around this issue by passing –no-sandbox flag when creating your WebDriver session, such a configuration is unsupported and highly discouraged. You need to configure your environment to run Chrome … Read more

Getting text from a node

You can’t do this in the WebDriver API, you have to do it in your code. For example: var textOfA = theAElement.getText(); var textOfSpan = theSpanElement.getText(); var text = textOfA.substr(0, textOfA.length – textOfSpan.length).trim(‘\n’); Note that the trailing newline is actually part of the text of the <a> element, so if you don’t want it, you … Read more

What is benefit of using ChromeDriver over WebDriver if we are using only Chrome Browser in our Selenium Automation Script

ChromeDriver driver = new ChromeDriver(); If you use ChromeDriver driver = new ChromeDriver(); the ChromeDriver instance which will get created through that we will be only able to invoke and act on the methods implemented by ChromeDriver and supported by Chrome Browser only. To act with other browsers we have to specifically create individual objects … Read more

Reached error page: about:neterror when trying to navigate to other tabs if there is a form submit under that tab

This error message… org.openqa.selenium.WebDriverException: Reached error page: about:neterror?e=connectionFailure&u=https%3A//192.168.1.20/network.cgi&c=UTF-8&f=regular&d=Firefox%20%E6%97%A0%E6%B3%95%E5%BB%BA%E7%AB%8B%E5%88%B0%20192.168.1.20%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E8%BF%9E%E6%8E%A5%E3%80%82 …implies that there was a Network Error while initializing a WebDriver / Web Browsing session. However, the main issue is, in case of these Network Errors for a valid and absolute URL it is expected for the WebDriver instance i.e. the driver to return a value of … Read more

unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.9

I finally managed to get Selenium tests starting the Chrome Driver on my laptop (server). The important bit is to use Xvfb. Don’t ask me why but once you accept this fact follow these steps (more detailed than @Anon answer) In you Jenkins settings add a global property key : DISPLAY value:0:0 On your server … Read more

release Selenium chromedriver.exe from memory

per the Selenium API, you really should call browser.quit() as this method will close all windows and kills the process. You should still use browser.quit(). However: At my workplace, we’ve noticed a huge problem when trying to execute chromedriver tests in the Java platform, where the chromedriver.exe actually still exists even after using browser.quit(). To … Read more

How to launch all Karate features setting up which browser to use as an external maven variable

With the suggestions of Peter Thomas I used this karate-config.js function fn() { // browser settings, if not set it takes chrome var browser = karate.properties[‘browser’] || ‘chrome’; karate.log(‘the browser set is: ‘ + browser + ‘, default: “chrome”‘); // grid flag, if not set it takes false. The grid url is in this format … Read more

Timed out receiving message from renderer: 0.100 log messages using ChromeDriver and Chrome v80 through Selenium Java

Interim solution Here are the solutions for different variants of Chrome users. If you are using Chrome v80, using the recently released ChromeDriver 80.0.3987.106 solves the issue. Code Block: System.setProperty(“webdriver.chrome.driver”, “C:\\Utility\\BrowserDrivers\\chromedriver.exe”); WebDriver driver = new ChromeDriver(); driver.quit(); Console Output: Starting ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882}) on port 20041 Only local connections are allowed. Please protect ports used … Read more

wait.until(ExpectedConditions) doesnt work any more in selenium

I had the same issue. I fixed it by using the not deprecated .until() method of WebDriverWait and by adding the following to my maven pom.xml: <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>21.0</version> </dependency> Other than that, my code looks exactly like before. To be more specific there are now two .until() methods. The old one (which is … Read more