selenium grid listening on node port instead of hub port

If you intend to use Selenium in Grid configuration through Hub and Node configuration, I would suggest you to use the most recent selenium-server-standalone-3.6.0 jar as follows: Start the Selenium Grid Hub (by default on port 4444) : java -jar selenium-server-standalone-3.6.0.jar -role hub Confirm the Selenium Grid Hub is started: 16:06:29.891 INFO – Nodes should … Read more

Selenium Grid: MaxSessions vs MaxInstances

Nice question….i would say it’s bit confusing…. But will try to answer it in simple terms.. MaxInstances This says….how many instances of same version of browser can run over the Remote System. For example, i have a FF12,IE and i declared the command as follows -browser browserName=firefox,version=12,maxInstances=5,platform=LINUX -browser browserName=InternetExplorer,version=9.0,maxInstances=5,platform=LINUX So i can run 5 instances … Read more

What is the best way to avoid NoSuchElementException in Selenium?

You can never be sure that element will be found, actually this is purpose of functional tests – to tell you if anything changed on your page. But one thing which definitely helps is to add waits for the elements which are often causing NoSuchElementException like WebDriverWait wait = new WebDriverWait(webDriver, timeoutInSeconds); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id<locator>));

selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain while executing tests in Django with Selenium

This error message… selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain …implies that an illegal attempt was made to set a cookie under a different domain than that of the current document. Details As per the HTML-Living Standard Specs a Document Object may be categorized as a cookie-averse Document object in the following circumstances : A Document that … Read more

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

Can Selenium WebDriver open browser windows silently in the background?

If you are using Selenium web driver with Python, you can use PyVirtualDisplay, a Python wrapper for Xvfb and Xephyr. PyVirtualDisplay needs Xvfb as a dependency. On Ubuntu, first install Xvfb: sudo apt-get install xvfb Then install PyVirtualDisplay from PyPI: pip install pyvirtualdisplay Sample Selenium script in Python in a headless mode with PyVirtualDisplay: #!/usr/bin/env … Read more