Selenium Script pass in locally but fail on Jenkins while building - java

This is a very strange issue I am facing. I have my selenium scripts which work completely fine on my locally system when executed. Also I am using selenium grid for remote execution. When I try to run the same on my Jenkins which is installed on a VM my test fails. I have set my implicit timeout to 20 secs and page load timeout to 100 secs. Still I have the issue.
My Error logs on Jenkins for one of my failed test is:
Element not found exception.

Related

io.github.bonigarcia.wdm.WebDriverManagerException: java.nio.file.AccessDeniedException

I have the following error when start tests on remote VM via Jenkins, however tests work without any issues on my local machine.
io.github.bonigarcia.wdm.WebDriverManagerException: java.nio.file.AccessDeniedException: C:\Users\Administrator\.m2\repository\webdriver\geckodriver\win64\v0.26.0\geckodriver.exe
The tests worked correctly before and this issue started to appear from 30/04/2020/.
WebDriver manager version - 3.8.1,
geckodriverVersion - 0.26
In my case, forceDownload() allows the test to download and overwrite the current driver version folder. If geckodriver.exe is running on (check on Task Manager), so it could not overwrite a running program.
So, before executing the test, you should check whether that program is running or not. If it is running, you must force close geckodriver.exe.
Otherwise, don't forget that you should quit the driver if an exception occurs.
if (driver) {
driver.quit();
}
I have similar issue.
While running from Jenkins, it shows the following issue. But it would pass if I run it from windows cmd.exe.
io.github.bonigarcia.wdm.WebDriverManagerException: org.apache.http.conn.ConnectTimeoutException: Connect to chromedriver.storage.googleapis.com:443 [chromedriver.storage.googleapis.com/34.64.4.112] failed: Read timed out
at CsdAutomationE2E.testflows.script.JDCLOUD200618.TestStep1.beforeTest(TestStep1.java:56)

Getting black screenshot for ie driver server

I have recently upgraded selenium version to 3.141.59
IEdriver 3.14
When I trigger the scripts to execute under Jenkins remote machine, getting black screenshot and timeout exception occurred as I wait for next element.
Could you please explain possible solutions to me

Jenkins Parameterized Remote Trigger Plugin error"JSONArray[0] is not a JSONObject."

I am trying to trigger my automation test build from Dev build as downstream using the Jenkins plugin "Parameterized remote trigger"
Set up:
I have the automation builds on a different host machine
Automation host machine doesn't run Jenkins as Windows service, instead it is run through cmd java -jar jenkins.war (I require this to get display access, the check box in the service option doesn't do what I require)
Error I see on the Dev build job:
Even if I get the below error, the automation build gets triggered.
FATAL: JSONArray[0] is not a JSONObject.
net.sf.json.JSONException: JSONArray[0] is not a JSONObject.
at net.sf.json.JSONArray.getJSONObject(JSONArray.java:1977)
at
org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.perform(RemoteBuildConfiguration.java:563)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
at hudson.model.Run.execute(Run.java:1754)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Things tried:
I tried to start jenkins as a windows service I do not get that error, but my automation build fails due to no access to display(for webdriver-manager start).
https://issues.jenkins-ci.org/browse/JENKINS-30962
https://issues.jenkins-ci.org/browse/JENKINS-22325
any help will be appreciated.

Error running Selenium IDE "Error: Permission denied to access property 'nr#context'

Starting this morning (4/3/14), I have been getting errors when my Selenium IDE tests run against my site. These tests were working just fine yesterday. I am running FF 25, Selenium IDE 2.5.0. Whenever it gets to a step where it needs to click or clickandwait, I get this error,
"Error: Permission denied to access property 'nr#context' Filename -> XXXXX, lineNumber -> 5, columnNumber -> 376.
The filename changes depending on what page I happen to be on when running the test. It seems like a javascript error, but I can't see anything in the console. Could there have been a blind update to FF that occurred last night, since all these tests were working flawlessly yesterday afternoon?
Klendathu
I have found it!
In my case the problem with nr#context apear on servers where enabled New Relic monitoring and 'new relic script' present on the page (this script contains ...a="nr#context";...)
New Relic Browser agent v378, which contains a fix for this issue, was released this morning. You may need to restart your application server to pickup the new version.
To verify that you're running it, search the HTML source for 378.min.js

Selenium running as junit in ant prematurely closes browser but not in IDE

I've got a bunch of selenium test cases set up in a JUnit class as four methods. The first runs fine - but the remaining three close the Firefox browser before the final step of the method is complete - giving a
ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: this.page().currentDocument is undefined
com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: this.page().currentDocument is undefined
Setup is following:
Ant based execution
Java 1.5
Eclipse 3.5
Selenium Server 1.0.1
Selenium Client Driver 1.0.1
IDE
Java 1.5
Eclipse 3.5
Selenium Server 1.0.1
Selenium Client Driver 1.0.1
I'm hoping to track down the root cause
It is crashing on the following line:
This is the modification to the user-extensions.js file:
Selenium.prototype.getElementBody = function(elementId) {
return this.outerHTML(this.page().currentDocument.getElementById(elementId));
};
This is what is being called:
commandProcessor.getString("getElementBody", "idOfElement");
I have never seen a command called getString part of the Selenium API so think that is why your tests are failing.
The other thing is have you told Selenium RC to use the user-extensions.js file that you have modified with the following -userExtensions user-extensions.js argument? I have never found it beneficial to use user-extensions in Se:RC and instead use .getEval() commands.
what you want would be selenium.getEval("this.browserbot.getUserWindow().getElementByID(id).outerHTML");
I have cleaned up your JavaScript for you. The this.browserbot.getUserWindow() gives you access to the Selenium JavaScript object which has the page in it.
I hope that helps
Can you show us your JUnit test class ?
I know from personnal experience that once in a while Selenium tests can crash for no apparent reason, but your problem seems to be happening each time so it might have something to do with your code/script.
Afraid I can't help you without some more details.

Categories

Resources