I have a suite of Nightwatch tests that I regularly run across multiple browsers on Windows 10
Recently selenium has been unable to locate any elements when running Firefox through a local instance of Jenkins that is run as a Windows service. Firefox uses geckodriver webdriver in Nightwatch.
Test run flawlessly when run locally via cmd or git bash etc.
Anyone have any idea what may be causing this issue.
Versions installed:
Geckodriver v.0.19.1
Firefox v.57.0.4
Nightwatch v0.9.19
Selenium-server-standalone-3.8.1
Failure trace snippet
Starting selenium server... started - PID: 3804
[Widgets\ C36310 Widgets Available On Dispatch] Test Suite
==============================================================
Running: C36310 Widgets Available On Dispatch
√ Details & Strings Loaded
√ Home Page Element Selectors Loaded
× Check For Visibility Of Sign In Banner. - expected "visible" but got:
"not visible"
at Object.exports.command (C:\Users\matthewf\Documents\master-ui\workspace\Workspaces\master_eld\src\resources\custom_commands\login.js:22:6)
Related
Environment:
selenium-server-standalone-3.8.1.jar
geckodriver-v0.24.0
firefox 60.6.1
Everything was set up 6 months ago and everything worked well, the tests passed through the Selenium and there were no problems.
Since 08/23/2019 problems began. Without any launches test inside the Selenium process, started to run spontaneously browsers (firefox) and did not turn off.
These processes overload the processor on the server, after which the server starts to brake and also the site that is on the server. These "browser launches" continue until Selenium is reloaded by open browsers after which our automatic tests are blocked and display an error: "unable to create new native thread".
As soon as one such browser spontaneously opens, the processor load becomes 100%.
These browser launches occur approximately 1 time in 4-5 minutes.
All tests are disabled, but Selenium lives its own life, and continues to launch the browsers.
Maybe someone faced a similar problem? Any ideas why this is happening and how to fix it?
The launch of selenium occurs on command:
su screener -c "/usr/bin/java -Dwebdriver.gecko.driver=/usr/local/bin/geckodriver -jar /usr/lib/selenium/selenium-server-standalone-3.8.1.jar -enablePassThrough false -port 4444 >/var/log/selenium/selenium_std.log 2>/var/log/selenium/selenium_error.log &"
Term yourself lucky to have sailed smoothly with geckodriver-v0.24.0 and selenium-server-standalone-3.8.1.jar till 08/23/2019.
As per the documentation:
To work with geckodriver-v0.24.0 you need:
Selenium Python client version greater then 3.14
Firefox client version minimum 57 (which seems to be okay)
You can find the detailed GeckoDriver, Selenium and Firefox Browser compatibility chart in the discussion Which Firefox browser versions supported for given Geckodriver version?
Additional considerations
As a part of the best practices:
Upgrade JDK to recent levels JDK 8u222.
Upgrade Selenium to current levels Version 3.141.59.
Upgrade GeckoDriver to GeckoDriver v0.24.0 level.
GeckoDriver is present in the desired location.
GeckoDriver is having executable permission for non-root users.
Upgrade Firefox version to Firefox v65.0.2 levels.
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
http://www.yourownlinux.com/2013/10/how-to-free-up-release-unused-cached-memory-in-linux.html) before and after the execution of your Test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your Test as a non-root user.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
You can find a detailed discussion in PhantomJS web driver stays in memory
If the stale WebDriver instances still persist you may require to forcefully remove them.
You can find a detailed discussion in Selenium : How to stop geckodriver process impacting PC memory, without calling driver.quit()?
Outro
Limit chrome headless CPU and memory usage
Complete error
org.openqa.selenium.WebDriverException: Element is not clickable at
point (931, 23). Other element would receive the click:
Running selenium tests using Jenkins in headless browser
In following environment
OS- CentOS 6 and Xvfb installed in same machine
Xvfb screen resolution - Xvfb :1 -screen 0 1280x1024x16 &
Driver - Firefox driver
Selenium webdriver version - 2.52.0
The same test case working fine in windows os with firefox
Try this. Install Xvfb plugin on Jenkins.
After that install Xvfb in "Global Tool Configuration"
Then under your project configuration, setup xvfb
Try Using resolution given in image
Now run your build :)
This is the reason it is important to test on different browsers and on different platforms. Sometimes what works on one browser/os does not work on the same browser but a different platform.
I would update your setup so that you make a screenshot when you run into this type (and most other types) of error. In my experience this is the single best thing you can do to reduce the time spent to debug these issues.
In my setup I do the following:
Create a screenshot
Capture the coordinates from the Selenium error message
Use an image manipulation program to automatically create a red dot where the click happened
Usually I just have to take one look at such an image to see exactly what is happening.
How do I run test cases made with Selenium IDE (Firefox Plugin) in a headless browser?
When I create test cases with the firefox plugin it saves them as .html files.
I am trying to setup a way of running them in a headless browser, (using phantomJS or another tool/lib). I have seen many people mention running firefox in a hidden frame, but this is not the same as headless (ie. PhantomJS)
I have already figured out how to run selenium test cases from command line, but only in firefox or ie, I can't get it to run .html testcases on phantomjs:
java -jar selenium-server-standalone-2.39.0.jar -htmlSuite "*firefox" "http://127.0.0.1" "ts-ProjectList/TestSuite.html" "ProjectList-results.html"
I know the IDE can export test cases in different languages, but I want non-tech team members to be able to create tests using the firefox plugin.
Have you looked at http://code.tutsplus.com/tutorials/headless-functional-testing-with-selenium-and-phantomjs--net-30545?
Changing "*firefox" to phantomjs should get you started.
You'll need the phantomJS driver:
http://selenium.googlecode.com/svn/trunk/docs/api/py/webdriver_phantomjs/selenium.webdriver.phantomjs.webdriver.html
I have written 3 test cases
1 open the Google site in Firefox browser and search
2 open the Google site in Chrome browser and search
3 Printing some messages,no browser involved
From Eclipse I can run the above test cases properly
if i run testng.xml as testNG site From Eclipse then also all the above test cases running properly
but When ever i am trying to run my webdriver test cases from command prompt through ANT using build.xml
For the chrome browser it showing alert related to manifest version and for Firefox browser its showing error related to Unable to bind to locking port 7054 and my first two test cases getting failed. [ i have attached the fail report of those test cases ]
Can any one give some suggestion what changes are required so that i can run my test cases properly from ant
I am using selenium Webdriver java build [ latest one]
Framework : TestNg
Editor : Eclipse
Firefox browser version : 22.0
Chrome Browser version : 28.0.1500.72 m
OS: Windows 7 Ultimate
I have attached the screenshot related to
1 chrome browser alert
2 chrome browser which opened but not able to open the site
3 Fail report of the test case which involved firefox driver
4 Fail report of the test case which involved chrome driver.
5 Screenshot of my project setup
Checking your system path for a path to chrome and FF might help . That worked for me though I didn't have a similar error.
I have a problem with Selenium under Jenkins 1.446 together with Xvfb: It looks like firefox is started correctly because I let my failing tests record screenshots. These screenshots all show the same failing page, which in my case is the starting page where the tests should begin. So I gues the selenium WebDriver commands do not arrive. What could be the reason? By the way, the tests are running perfectly on my local machine.
I'm using Firefox 9.0.1 with no specific test profile and no AddOns, Ubuntu 10.04, Senlenium 2.16.1
Log entry: com.thoughtworks.selenium.SeleniumException: Timed out waiting for action to finish
Thanks!
EDIT: Issue seems to be fixed by a system reboot ...
I experienced a very similar issue with FF9.0.1 and Selenium 2.16.1 running through JUnit launched by Maven SureFire plugin run by Jenkins on a WinXP node.
2.17.0 fixed the issue for me. Try updating to the latest Selenium.
Through RDP, I was able to watch the tests running. The tests appeared to be partially blocked by a prompt from Firefox asking about collecting anonymous usage statistics. Manually answering the prompt would allow the test to continue but because Selenium creates a new profile each time by default, the prompt would return on the next browser launch. Running the tests locally with a pre-configured FF profile allowed me to persist that the prompt had been answered. This isn't possible on my XP node because the tests are running as 'System'.
Selenium/WebDriver would normally take care of this for you by marking the prompt as already answered in a temporary FF profile configuration but a bug was causing the value to be set to the wrong value. You can inject a profile configuration to the Selenium FirefoxDriver driver to pragmatically configure stuff like this prompt but the bug appeared to prevent this as well. This has been resolved in Selenium 2.17.0 (http://selenium.googlecode.com/svn/trunk/java/CHANGELOG see 2.17.0 WebDriver bug fixes).