This is the only output I get when I run the tests. Do I need to add the geckodriver.exe somewhere in my build path or linked resources?
Console Output:
Jun 16, 2016 4:17:38 PM io.github.bonigarcia.wdm.BrowserManager getLatest
INFO: Latest version of [wires, geckodriver] is 0.8.0
C:\Users\aconte/.m2/repository/webdriver/geckodriver\0.8.0/geckodriver-v0.8.0-win32.zip
Jun 16, 2016 4:17:38 PM io.github.bonigarcia.wdm.BrowserManager exportDriver
INFO: Exporting webdriver.gecko.driver as C:\Users\aconte\.m2\repository\webdriver\geckodriver\win32\0.8.0\geckodriver.exe
<- |50:{"applicationType":"gecko","marionetteProtocol":3}|
54:{"name":"getMarionetteID","to":"root","parameters":{}}
This my code for setting up the driver.
FirefoxProfile ffprofile = new FirefoxProfile();
ffprofile.setEnableNativeEvents(true);
ffprofile.setPreference("xpinstall.signatures.required", false);
driver = new MarionetteDriver(ffprofile);
Related
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.
I'm facing some trouble working on VisualVM on Mac.
Whenever I run the visualvm app (either from the app installed or by going to /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm (unix executable file) it opens the terminal, for a moment visualvm also starts and then the following is printed in the terminal and visualvm closes
Last login: Thu Dec 7 22:15:06 on ttys000
Kingshuks-MacBook-Pro:~ kingshuk$ /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm ; exit;
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
I have recently upgraded from Sierra to High Sierra. I think I have used visualvm before this upgrade, might be once or twice though.
Any help to resolve this issue would be great..!! Please let me know if any additional information is needed.
I tried to use
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm -J-Dnetbeans.logger.console=true but got the following error. Guess this is because I don't have netbeans installed??
Last login: Sat Dec 9 16:21:57 on console
Kingshuks-MacBook-Pro:~ kingshuk$ /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm -J-Dnetbeans.logger.console=true
-bash: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm: No such file or directory
Kingshuks-MacBook-Pro:~ kingshuk$ /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/jvisualvm -J-Dnetbeans.logger.console=true
-------------------------------------------------------------------------------
>Log Session: Saturday, December 9, 2017 4:41:03 PM EST
>System Info:
Product Version = Java VisualVM
Operating System = Mac OS X version 10.13.1 running on x86_64
Java; VM; Vendor = 1.8.0_152; Java HotSpot(TM) 64-Bit Server VM 25.152-b16; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 1.8.0_152-b16
Java Home = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre
System Locale; Encoding = en_US (visualvm); UTF-8
Home Directory = /Users/kingshuk
Current Directory = /Users/kingshuk
User Directory = /Users/kingshuk/Library/Application Support/VisualVM/8u131
Cache Directory = /Users/kingshuk/Library/Caches/VisualVM/8u131
Installation = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/profiler
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform
Boot & Ext. Classpath = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/classes:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/System/Library/Java/Extensions/MRJToolkit.jar
Application Classpath = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/boot.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-modules.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-util-lookup.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/org-openide-util.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/boot_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/boot_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-modules_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-modules_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util-lookup_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/locale/org-openide-util_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/tools.jar
Startup Classpath = /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/org-openide-filesystems.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/core.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/locale/core_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/locale/org-openide-filesystems_ja.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/locale/org-openide-filesystems_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/core/locale/core_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm/core/com-sun-tools-visualvm-modules-startup.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/com-sun-tools-visualvm-modules-startup_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/core_visualvm.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/visualvm/core/locale/com-sun-tools-visu
alvm-modules-startup_ja.jar
-------------------------------------------------------------------------------
java.lang.NullPointerException
at java.awt.Window.init(Window.java:497)
at java.awt.Window.<init>(Window.java:537)
at java.awt.Frame.<init>(Frame.java:420)
at org.netbeans.core.startup.Splash.setRunning(Splash.java:119)
at org.netbeans.core.startup.Main.start(Main.java:257)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:84)
at java.lang.Thread.run(Thread.java:748)
Kingshuks-MacBook-Pro:~ kingshuk$
I was also able to notice that the visualvm script calls the nbexec file. And when I tried to run that independently, I got the below error on the console.
Last login: Wed Dec 20 17:56:02 on ttys000
Kingshuks-MacBook-Pro:~ kingshuk$ /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/visualvm/platform/lib/nbexec ; exit;
java.io.FileNotFoundException: /var/cache/lastModified/all-checksum.txt (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at org.netbeans.Stamps.compareAndUpdateFile(Stamps.java:444)
at org.netbeans.Stamps.stamp(Stamps.java:331)
at org.netbeans.Stamps.moduleJARs(Stamps.java:282)
at org.netbeans.Stamps.file(Stamps.java:168)
at org.netbeans.Stamps.asByteBuffer(Stamps.java:173)
at org.netbeans.Stamps.asStream(Stamps.java:129)
at org.netbeans.Stamps.checkPopulateCache(Stamps.java:540)
at org.netbeans.Stamps.file(Stamps.java:160)
at org.netbeans.Stamps.asByteBuffer(Stamps.java:173)
at org.netbeans.Stamps.asByteBuffer(Stamps.java:153)
at org.netbeans.Archive.<init>(Archive.java:81)
at org.netbeans.JarClassLoader.initializeCache(JarClassLoader.java:68)
at org.netbeans.MainImpl$BootClassLoader.run(MainImpl.java:298)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:559)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:345)
at org.netbeans.MainImpl.execute(MainImpl.java:154)
at org.netbeans.MainImpl.main(MainImpl.java:46)
at org.netbeans.Main.main(Main.java:44)
Thanks..!!
I am new on using Selenium and I faced some questions on using RemoteWebDriver in Selenium Grid 2. I would like to what's wrong in my code. Thanks.
I set the RemoteWebDriver in 3 steps:
Set the Chrome driver to system property, I checked the path is correct.
Set the capabilities
Turn on the driver by RemoteWebDriver
logger.info("1. Start");
File file = new File("/path/of/chromedriver");
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
logger.info("2. Get Path: " + file.getAbsolutePath());
DesiredCapabilities caps = new DesiredCapabilities();
caps.setBrowserName(DesiredCapabilities.chrome().getBrowserName());
logger.info("3. Set capabilities: " + caps);
URL url = new URL(URL);
RemoteWebDriver driver = new RemoteWebDriver(url, caps);
logger.info("4. Initialize driver: " + driver);
logger.info("5. End");
return driver;
The result pass first 2 steps but fail in the last step because the log does not show. It seems there is a problem in setting RemoteWebDriver. The log is shown as below:
May 16, 2017 8:28:16 PM com.test.Setup setupDriver
INFO: 1. Start
May 16, 2017 8:28:16 PM com.test.Setup setupDriver
INFO: 2. Get Path: /path/of/chromedriver
May 16, 2017 8:28:16 PM com.test.Setup setupDriver
INFO: 3. Set capabilities: Capabilities [{browserName=chrome}]
May 16, 2017 8:28:16 PM com.test.Setup setupDriver
SEVERE: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
Can anyone suggest where is the problem, thanks!
selenium-server-standalone-3.4.0.jar
selenium-java-3.4.0
chromedriver 2.29
java version "1.8.0_111"
TestNG
The exception says it all.
May 16, 2017 8:28:16 PM com.test.Setup setupDriver SEVERE: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
Please ensure you do the following on the machine in which you are running the node.
Have the location of the chromedriver binary made available as part of your PATH environment variable.
Now to ensure that the location is properly set, open up a new command prompt/terminal and type chromedriver.
You should see an output as below (my output is from a MAC)
12:16 $ chromedriver
Starting ChromeDriver 2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b) on port 9515
Only local connections are allowed.
Once you see a similar output, you can try running your test again and you should be fine.
I am trying to start opera(v 36.0) using selenium 2.53.0 and Opera chromium driver _win64 (0.2.2).
When I try to run sample code, an exception occurred and browser didn't started.
Sample code:
File pathToOpera = new File("E://operadriver.exe");
DesiredCapabilities cap = DesiredCapabilities.operaBlink();
cap.setCapability("webdriver.opera.driver",pathToOpera);
driver = new OperaDriver(cap);
I am getting error as
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.opera.driver system property; for more information, see https://github.com/operasoftware/operachromiumdriver. The latest version can be downloaded from https://github.com/operasoftware/operachromiumdriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
at org.openqa.selenium.opera.OperaDriverService.access$0(OperaDriverService.java:1)
at org.openqa.selenium.opera.OperaDriverService$Builder.findDefaultExecutable(OperaDriverService.java:118)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.opera.OperaDriverService.createDefaultService(OperaDriverService.java:82)
at org.openqa.selenium.opera.OperaDriver.<init>(OperaDriver.java:137)
My execution environment: win 8, 64 bit
Add before Your code:
System.setProperty("webdriver.opera.driver","E://operadriver.exe");
System.setProperty("opera.binary","E://yourOperaPath.exe");
I am new to Selenium. Trying following code and it works for Firefox.
When I try for Safari, getting error.
package MyTestPkg;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.safari.SafariDriver;
public class MyTestClass {
public static void main(String[] args) {
//WebDriver driver = new FirefoxDriver();
WebDriver driver =new SafariDriver();
driver.get("http://only-testing-blog.blogspot.in");
String i = driver.getCurrentUrl();
System.out.println(i);
driver.close();
}
}
OSX 10.10.3
Selenium 2.46
Safari 8.0.6
ERROR
Jun 22, 2015 5:47:12 PM org.openqa.selenium.safari.SafariDriverServer start
INFO: Server started on port 43288
Jun 22, 2015 5:47:12 PM org.openqa.selenium.safari.SafariDriverCommandExecutor start
INFO: Launching Safari
Jun 22, 2015 5:47:12 PM org.openqa.selenium.safari.SafariDriverCommandExecutor start
INFO: Waiting for SafariDriver to connect
Jun 22, 2015 5:47:14 PM org.openqa.selenium.safari.SafariDriverChannelHandler$1 operationComplete
INFO: Connection opened
Jun 22, 2015 5:47:14 PM org.openqa.selenium.safari.SafariDriverCommandExecutor start
INFO: Driver connected in 1998 ms
Jun 22, 2015 5:47:14 PM org.openqa.selenium.safari.SafariDriverCommandExecutor stop
INFO: Shutting down
Jun 22, 2015 5:47:14 PM org.openqa.selenium.safari.SafariDriverCommandExecutor stop
INFO: Closing connection
Jun 22, 2015 5:47:14 PM org.openqa.selenium.safari.SafariDriverCommandExecutor stop
INFO: Stopping Safari
Jun 22, 2015 5:47:14 PM org.openqa.selenium.safari.SafariDriverCommandExecutor stop
INFO: Stopping server
Jun 22, 2015 5:47:14 PM org.openqa.selenium.safari.SafariDriverServer stop
INFO: Stopping server
Jun 22, 2015 5:47:14 PM org.openqa.selenium.safari.SafariDriverCommandExecutor stop
INFO: Shutdown complete
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:17:10'
System info: host: 'Lajeeshs-MacBook-Pro.local', ip: '192.168.1.224', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_45'
Driver info: driver.version: SafariDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
at org.openqa.selenium.safari.SafariDriver.<init>(SafariDriver.java:58)
at org.openqa.selenium.safari.SafariDriver.<init>(SafariDriver.java:42)
at MyTestPkg.MyTestClass.main(MyTestClass.java:10)
Caused by: java.lang.ClassCastException: com.google.gson.JsonObject cannot be cast to java.lang.String
at org.openqa.selenium.remote.JsonToBeanConverter.convert(JsonToBeanConverter.java:111)
at org.openqa.selenium.remote.JsonToBeanConverter.convert(JsonToBeanConverter.java:42)
at org.openqa.selenium.safari.SafariDriverCommandExecutor.execute(SafariDriverCommandExecutor.java:191)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:578)
... 6 more
Any pointer how to fix this problem.
The error message says it all:
Could not start a new session.
Possible causes are invalid address of the remote server or browser start-up failure.
In this case, unless you had a network glitch that didn't allow you to access the website, it is the latter - i checked the URL and it is working fine.
So the error lies with the Safari browser.
Note that running your Selenium tests on a different browser tends to require additional setup.
You could try manually installing the Safari Driver as described here if it is actually installed.