Cannot open display browser:99, error 1. browser:99: I/O error - webdriver-io

While running WDIO scripts on Jenkins, it throws I/O error after 20+ test cases are ran.

Related

Azure Devop TestThe active test run was aborted. Reason: Test host process crashed : Unhandled Exception

We have one PR that fails due to our tests sets. They only fail with this PR, with the following error:
The active test run was aborted. Reason: Test host process crashed : Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
It always crashes with this error while other branches work fine. It's always the same exception but not everytime at the same position. We tried to enable diagnostic, but it gives absolutely no additional informations:
##[debug]ProxyRunRequest: HandleLogMessage Entered
##[error]RunMessage : The active test run was aborted. Reason: Test host process crashed : Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
##[debug]Processed: ##vso[task.logissue type=error;]RunMessage : The active test run was aborted. Reason: Test host process crashed : Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
We use Nunit, and the testing part of our YML is the following:
- task: VSTest#2
timeoutInMinutes: 180
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: '*.Test*.dll'
searchFolder: '$(System.DefaultWorkingDirectory)/$(buildConfiguration)'
codeCoverageEnabled: false
platform: 'Any CPU'
uiTests: false
configuration: '$(buildConfiguration)'
runInParallel: true
resultsFolder: 'testResults'
runSettingsFile: '$(Build.SourcesDirectory)\azure-tests.runsettings'
rerunFailedTests: true
The PR is like 200 files and we can't find what could cause the issue, especially since we spent a lot of time testing as its a critical feature for us.
Any idea what we can do to have a better idea of what the problem is? Or what could causes this exception?

Mocha, Electron: Errors in testing

I was testing my electron app with mocha and got this error several times (and I'm still getting it!). Every time I run the program it returns with the error
> Executing task: npm run test <
> forte#1.0.0 test PATH TO PROJECT
> mocha ./tests/test.js
0 passing (3ms)
Test failed Failed to create session.
unknown error: Chrome failed to start: was killed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location \node_modules\spectron\lib\launcher.bat is no longer running, so ChromeDriver is
assuming that Chrome has crashed.)
Just in case this is important, the part which says (The process started from chrome location \node_modules... actually had the whole path, not just that.
In my test.js file I have the code from the spectron home page, which you can view here. What is wrong with the test files?

Not able to run selenium test cases in jenkins

1)I have created a job in Jenkins to run selenium tests cases which consists of 5 feature files
2)I am using "Execute Shell" of Jenkins to run the test cases
where I have fired the command by going to that particular folder and running command gradle test
eg. >cd ABC
>gradle test
when I run this job by using "build Now" the test cases fails showing error
1)java.lang.IllegalStateException: Failed to load ApplicationContext
2)Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'getWebDriver' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.cosmicapp.webbrowser.FirefoxWebDriver
3)caused by java.lang.NoClassDefFoundError: Could not initialize class com.cosmicapp.webbrowser.FirefoxWebDriver
And when I run the above test cases on my machine it runs fine.
It seems there is a problem in the Jenkins project workspace or Jenkins is not able to invoke firefox or chrome browser.

Selenium Exception with no stack trace (grunt / protractor / selenium)

I try to run grunt test, and Selenium exits without closing the browser. I am unable to see where the exception is coming from.
grunt test
Running "protractor_webdriver:start" (protractor_webdriver) task
Starting Selenium server
Started Selenium server: http://127.94.0.1:4444
Running "protractor:projecttest" (protractor) task
[10:16:33] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[10:16:33] I/launcher - Running 1 instances of WebDriver
Session created: count=1, browserName=chrome
......Exception thrown: Going to shut down the Selenium server
Shutting down Selenium server: http://127.94.0.1:4444
Shut down Selenium server: http://127.94.0.1:4444 (OKOK)
Fatal error: 10:16:45.529 WARN - Exception thrown
All of my tests are passing. I even added logs to prove the final test passes and exits without exception.
I tried to up my logging from "dots" to "progress" but it doesn't change anything. Any ideas?

Jenkins return job status SUCCESS when the test failed

I am automating my protractor integration tests using Jenkins. When some of the tests fails Jenkins weeps saying that the result was successful. This is my output:
24 specs, 1 failure
Finished in 64.079 seconds
Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 failed 1 test(s)
[launcher] overall: 1 failed spec(s)
[launcher] Process exited with error code 1
Test failed but keep the grunt process alive.
Done, without errors.[39m
Terminating xvnc.
$ vncserver -kill :28
Killing Xtightvnc process ID 24369
Finished: SUCCESS
I don't know if my problem is selenium or grunt related.
Does any one know what can be the problem? Thanks in advance!
Looks like this Jenkins job is not set up properly, I suggest you review your Job Configuration.
After some research I found out the problem.
I am using "grunt-protractor-runner" library. It has an option call "keepAlive" and it was set to true. This caused the process to continue even is something was wrong and not passing the error code to grunt.
After set it up to false everything behave as expected.