JMeter web driver logging - selenium

Is there a way to suppress output from the web driver - e.g.
Feb 09, 2023 1:22:13 PM org.openqa.selenium.chromium.ChromiumDriver lambda$new$3
WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.7.2` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
Feb 09, 2023 1:22:14 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
WARNING: Unable to find CDP implementation matching 110
Feb 09, 2023 1:22:14 PM org.openqa.selenium.chromium.ChromiumDriver lambda$new$3
WARNING: Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.7.2` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
ChromeDriver was started successfully.

If this is really what you want:
Add a setUp Thread Group to your Test Plan
Add JSR223 Sampler to the Thread Group
Put the following code into "Script" area:
java.util.logging.LogManager.getLogManager().reset()
def globalLogger = java.util.logging.Logger.getLogger(java.util.logging.Logger.GLOBAL_LOGGER_NAME)
globalLogger.setLevel(java.util.logging.Level.OFF)
Next time you run your test all Selenium-related logging will go away.

Related

After upgrading karate version to 1.0.0 cucumber reports are not generated

After upgrading karate version to 1.0.0 cucumber reports are not generated. though no test is failed
Error message:
Mar 17, 2021 4:54:06 PM net.masterthought.cucumber.ReportBuilder generateErrorPage
INFO: Unexpected error
net.masterthought.cucumber.ValidationException: None report file was added!
at net.masterthought.cucumber.ReportParser.parseJsonFiles(ReportParser.java:61)
Note:
Working fine with 0.9.6 version
As per upgrade notes: https://github.com/intuit/karate/wiki/1.0-upgrade-guide
HTML reports (and other artifacts) will be in target/karate-reports (or build/karate-reports for Gradle)
so if your CI was pointing to /surefire-reports, this has to be changed
The Cucumber JSON and JUnit XML files are NOT output by default
use the builder methods on the Runner, there is also outputJunitXml(true)
Results results = Runner.path("classpath:demo")
.outputCucumberJson(true)
.tags("~#ignore").parallel(5);
If you change as per above in your runner - reports will be generated.

org.openqa.selenium.remote.ProtocolHandshake createSession INFORMATION: Attempting bi-dialect session with Selenium Grid

I set up a local selenium grid to test something. The build runs normal when connecting to another grid but when using the local grid the build just stops at this point:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running xxx.xxxxxxxxxxxx.xxx.xxxxxxxxxxx.XXXXXXXXXXXX
Sep 17, 2018 3:13:49 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
No error message at all. I wasn't able to achieve anything with -X and -Dwebdriver.server.session.timeout=7200
It just hangs there and I get nothing
This error message...
org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMATION: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
As per the discussion Attempting bi-dialect session, assuming Postel's Law holds true on the remote end thread 'webdriver dispatcher' panicked at 'index out of bounds: the len is 0 but the index is 0 this issue was reproducible with Selenium Client v3.0.0-beta3 released on 2016-09-01 14:57:03 -0700 with GeckoDriver.
Simon in a comment mentioned that:
The root cause was a ClassCastException. We now catch that exception, log the thing that we were trying to parse and continue with other attempts to complete the handshake. The fix was available in Selenium Client v3.0.0-beta4.
Solution
Upgrade JDK to recent levels JDK 8u181.
Upgrade Selenium to current levels Version 3.14.0.
Upgrade GeckoDriver to GeckoDriver v0.20.1 level.
GeckoDriver is present in the specified location.
GeckoDriver is having executable permission for non-root users.
Upgrade Firefox version to Firefox v61.0.2 levels.
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
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.

Getting file information during a Karma test

I have a large number of files that I run through Karma and Jasmine for testing†. In the middle of the process I get an uncaught error which halts the project. This means that I cannot easily determine which file is causing the fatal error. Is there a way to print out the name of a file as it is being tested or get similar information that I can analyze?
† More specifically, I am running an Angular project using Angular CLI, which employs Karma and Jasmine.
Edit:
I have been asked for screenshots and code, but there's not much to show. When I run karma I get this response:
19 09 2017 00:04:18.279:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/
19 09 2017 00:04:18.281:INFO [launcher]: Launching browser Chrome with unlimited concurrency
19 09 2017 00:04:18.285:INFO [launcher]: Starting browser Chrome
19 09 2017 00:04:42.723:INFO [Chrome 61.0.3163 (Mac OS X 10.12.6)]: Connected on socket Ml1MJK4zgJuXwLyxAAAA with id 34080921
................................................................................
................................................................................
................................................................................
.....................................................Chrome 61.0.3163 (Mac OS X 10.12.6) ERROR
Uncaught Error: No component factory found for FooComponent. Did you add it to #NgModule.entryComponents?
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:8310
Chrome 61.0.3163 (Mac OS X 10.12.6) ERROR
Uncaught Error: No component factory found for FooComponent. Did you add it to #NgModule.entryComponents?
at http://localhost:9876/_karma_webpack_/polyfills.bundle.js:8310
Chrome 61.0.3163 (Mac OS X 10.12.6): Executed 293 of 739 (skipped 44) ERROR (10.515 secs / 1.461 secs)
I am running 739 unit tests and the process halts after 293. I cannot find the file causing the FooComponent error (it's something subtle and cannot be identified with a keyword search). This is why I need to know the name of the file, or the test, or the something that is causing the error.
You could use a custom Karma reporter to view more details on which tests are failing etc.
One option is karma-spec-reporter.
Installation and usage is simple (copied from the github README):
npm install karma-spec-reporter --save-dev
Then add 'spec' to reporters in karma.conf.js, e.g.
reporters: ['spec']
There are also other options for Karma reporters.
Karma-mocha-reporter is one option.
If you're after a bit of a laugh, you could also look at the karma-nyan-reporter for a bit of nyan-cat relief. Perhaps surprisingly, it also seems to give some useful error logging as well.

error starting tomee server from eclipse servers tab

My OS is win 7 ultimate 32 bit
After installing JDK 7u9, eclipse Juno (4.2) SR1 for Java EE
and finally adding into it the new server
Apache TomEE 1.5.0 October 2nd, 2012 apache-tomee-1.5.0-webprofile.zip
(using eclipse wizard to add new servers and choosing tomcat 7 profile and then the directory where it's installed)
i'm getting the following console error
...
...
...
nov 13, 2012 8:07:53 PM org.apache.tomee.catalina.OpenEJBContextConfig processAnnotationsFile
SEVERE: OpenEJBContextConfig.processAnnotationsFile: failed.
java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 32
C:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\testtomee01\WEB-INF\classes
^
at java.util.regex.Pattern.error(Unknown Source)
...
...
...
the server, eventually seems to start but then you get the 404 error on every page under http://localhost:8080/
tomEE installation directory is C:\apache-tomee-webprofile-1.5.0
eclipse installation directory is C:\eclipse
and java jre under C:\Program Files\Java\jre7
It looks like the current Windows release is broken. You'll have to download a fixed version as suggested in the bug report found here: https://issues.apache.org/jira/browse/TOMEE-436
The 1.5.1 snapshots are available for download here: 1.5.1-SNAPSHOT
Yes, should have been fixed and included in the next release (1.5.1).
FYI, it should be available next week.
Jean-Louis

SeleniumRC FF3.5.x-3.6 lock file troubles

With Selenium RC 1.0.1, and FF3.5.x or 3.6 I keep seeing this error when trying to run any test,
Failed to start new browser session:
Unable to delete file
\parent.lock
when running the server with either,
java -jar selenium-server.jar -multiwindow
or
java -jar selenium-server.jar
Any one found a way to run a selenium RC test against those version of FF? Here's the full stack trace,
ERROR - Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: Firefox refused shutdown while preparing a profile
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai
tForFullProfileToBeCreated(FirefoxChromeLauncher.java:311)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.pop
ulateCustomProfileDirectory(FirefoxChromeLauncher.java:106)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.lau
nch(FirefoxChromeLauncher.java:83)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.lau
nchRemoteSession(FirefoxChromeLauncher.java:350)
at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchRem
oteSession(FirefoxLauncher.java:98)
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSessi
on(BrowserSessionFactory.java:357)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession
(BrowserSessionFactory.java:122)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession
(BrowserSessionFactory.java:84)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowse
rSession(SeleniumDriverResourceHandler.java:699)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(Se
leniumDriverResourceHandler.java:393)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleComman
dRequest(SeleniumDriverResourceHandler.java:364)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(Selen
iumDriverResourceHandler.java:125)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
245)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher$Fil
eLockRemainedException: Lock file still present! C:\DOCUME~1\ADMINI~1.SPS\LOCALS
~1\Temp\customProfileDirf09f31ccacf4468385010edaecd5925d\parent.lock
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai
tForFileLockToGoAway(FirefoxChromeLauncher.java:269)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.wai
tForFullProfileToBeCreated(FirefoxChromeLauncher.java:309)
... 20 more
INFO - Got result: Failed to start new browser session: Unable to d
elete file C:\DOCUME~1\ADMINI~1.SPS\LOCALS~1\Temp\customProfileDirf09f31ccacf446
8385010edaecd5925d\parent.lock on session null
Restarting the browser, and clearing the cache didn't help. Using FF 3.0.x works just fine.
Seems seleniumRC 1.0.2 just came out today with claimed support for FF3.6 and such. Is working for me.
I was able to fix this issue by following these instructions:
http://jira.openqa.org/browse/SRC-507
This is for an older version of Selenium, but it works just the same. I am having to use 1.0.1 (for IE compatibility) and it has the MaxVersion of FF at 3.5. It was throwing the same error as above.
I changed the various files to '3.6' and it works now.
I just downloaded Selenium RC 1.0.3, and it did NOT fix the problem for me.