My Jmeter-webdriver webdriver sampler script is executed finely on chrome browser, whereas when same script is executed the on htmlunitdriver it throws an error.
To configure a HtmlUnitdriver followed the steps:-
Thread Group > Add > Listener > jp#gc- HtmlUnitDriver Config
2016/12/23 14:26:51 ERROR - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function addEventListener in object [object Window]. (https://test.html
Build info: version: '2.52.0', revision: '4c2593d28', time: '2016-02-11 11:22:43'
System info: host: 'EN09', ip: '192.168.254.2', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111'
Driver info: driver.version: HtmlUnitDriver
Please let me know how to run Webdriver sampler script on Htmlunitdriver successfully
Quick checklist:
Are you able to run something "minimal" successfully, i.e.:
WDS.sampleResult.sampleStart()
WDS.browser.get('http://example.com')
WDS.sampleResult.sampleEnd()
If the answer is "No" - it may be installation issue, I would recommend reinstalling the Selenium/WebDriver Support plugins bundle via JMeter Plugins Manager:
Are you able to execute your test using HtmlUnitDriver from Java code (without JMeter)?
If the answer is "No" - check if the issue is present here: https://sourceforge.net/p/htmlunit/bugs/ and if not - report it.
If you can run your test scenario from Java and not able to run it with JMeter - report it to JMeter Plugins forum
The viable workaround for headless Selenium tests execution using JMeter is PhantomJS Driver
Related
I try to connect with Selenium in R using the Chrome browser on Win10.
I installed Chrome 74.0.3729.61 and added the chrome.exe path to the Environment Variables.
devtools::install_github("johndharrison/seleniumPipes")
devtools::install_github("ropensci/Rselenium")
#start selenium
selServ <- selenium()
# check ports
selServ$log()$stderr
# conect using port
sel <- remoteDr(browserName = "chrome", port = 4567)
gives me the following error message:
Called newSession - Try no: 1 of 3
Called newSession - Try no: 2 of 3
Called newSession - Try no: 3 of 3
Error detected:
Response status code : 500
Selenium Status code: 13
Selenium Status summary: UnknownError
Selenium Status detail: An unknown server-side error occurred while processing the command.
Selenium message: unknown error: cannot find Chrome binary
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29}),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 40 milliseconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: ... , os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'
Driver info: driver.version: unknown
Please check the response with errorResponse()
Please check the content returned with errorContent()
I found some guidance for Python (Cannot find Chrome binary with Selenium in Python for older versions of Google Chrome) and c# (Selenium WebDriver - Could not find Chrome binary), however, I do not know how to implement it in R.
IMHO you need to download and run chomedriver.exe(if you are using Windows 10, as you mentioned) before to use selenium.
Could you try below solution?
Solution 1. on command window
java -Dwebdriver.chrome.driver="C:/{yourPath}/selenium/chromedriver.exe" -jar "C:/{yourPath}/selenium/selenium-server-standalone-3.141.59.jar" -port 4567
or
Solution 2. direct use R script
rstudioapi::terminalExecute('java -Dwebdriver.chrome.driver="C:/{yourPath}/selenium/chromedriver.exe" -jar "C:/{yourPath}/selenium/selenium-server-standalone-3.141.59.jar" -port 4567')
Yes, both are same command exactly. You are able to use anyone you want.
I am unable to connect to the Selenium server.
I'm using RSelenium to automate data collection for a school project.
What baffles me is that it has worked every day for two weeks now, but I restarted my macbook so had to reconnect to the Selenium server, and now I can't make it run.
I've tried reinstalling firefox, the geckodriver, the selenium standalone server, and tried running it with chrome.
I've put this in the terminal:
java -jar /Users/x/data/selenium-server-standalone-3.141.59.jar -port 5556
This is what I do in R:
remDr <- RSelenium::remoteDriver(extraCapabilities = list(marionette = TRUE), port=5556)
remDr$open()
I get this error message when running remDr$Open():
Selenium message:Unable to create new service: GeckoDriverService
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'MacBook-Pro-3.local', ip: '[sensitive info removed]', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '11.0.2'
Driver info: driver.version: unknown
Error: Summary: SessionNotCreatedException
Detail: A new session could not be created.
Further Details: run errorDetails method
I am able to run it with Docker and Tight VNC, but sadly this throws a lot of errors as I need to use the debug version for my data collection.
Hmmm never seen this type of error before. #jdharrison can you look at this?
As the title says, I've got a script written using RSelenium to automate web navigation, using chrome as the browser. This script has worked fine for months now, but today when I tried to run it, I got the following message:
Selenium message:Unable to create new service: ChromeDriverService
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-
02T20:13:22.693Z'
System info: host: 'LAPTOP-22QM8890', ip: '192.168.133.65', os.name:
'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: unknown
Could not open chrome browser.
Client error message:
Summary: SessionNotCreatedException
Detail: A new session could not be created.
Further Details: run errorDetails method
Check server log for further details.
I'm pretty sure that I have installed the latest versions of Chrome and ChromeDriver, but this has not changed anything. I'm at a loss as to what caused this error to spontaneously appear today.
If you are using windows, just go inside C:\Users\Jeff\AppData\Local\binman and delete all directories inside (for me 4 directories including seleniumserver and geckodriver). Then just open RStudio and run eg
library(RSelenium)
rD <- rsDriver(browser = "chrome")
remDr <- rD$client
remDr$navigate("https://google.com")
Good luck.
Hi I'm trying to use RSelenium package in R on Windows 10.
Run command in cmd
java -Dwebdriver.chrome.driver="D:\Selenium\chromedriver.exe"
java -jar D:\Selenium\selenium-server-standalone-3.11.0.jar
and run code in R
remDr <- remoteDriver(browserName = "chrome", remoteServerAddr = "localhost", port = 4444L)
remDr$open()
But I get this following error
[1] "Connecting to remote server"
Selenium message:Unable to create new service: ChromeDriverService
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z'
System info: host: '*****', ip: '*****', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_144'
Driver info: driver.version: unknown
Error: Summary: SessionNotCreatedException
Detail: A new session could not be created.
Further Details: run errorDetails method
I downloaded Chrome(V66),The Chrome Webdriver(2.37),The Selenium Stand Alone Driver(3.11.0),all these are new version ,updated lately.
But I still get that error.Could someone please explain to me why?
issue solved.Command in cmd should be like the following code
java -Dwebdriver.chrome.driver="D:\Selenium\chromedriver.exe" -jar D:\Selenium\selenium-server-standalone-3.11.0.jar
I also got this very same issue- which got resolved by including -'chromeDriver.exe' path in command used for registering node.
like- >java -Dwebdriver.chrome.driver=C:\chromedriver_win32\chromedriver.exe -jar selenium-server-standalone-3.12.0.jar -role node -hub http://XX.XXX.XX:4444/grid/register
I try to use the RSelenium in windows with IE as browser as it seems there are some discrepancies with other browsers, and need some fixing with the newer versions.
I do as previously instructed in SO answers:
library(RSelenium)
startServer()
remDr <- remoteDriver(browser="internet explorer")
remDr$open()
remDr$open()
[1] "Connecting to remote server"
Selenium message:Unable to create new remote session. desired capabilities = Capabilities [{nativeEvents=true, browserName=internet explorer, javascriptEnabled=true, version=, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'CL5065F329EBF2', ip: '130.115.158.36', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_91'
Driver info: driver.version: InternetExplorerDriver
Error: Summary: SessionNotCreatedException
Detail: A new session could not be created.
class: org.openqa.selenium.SessionNotCreatedException
Further Details: run errorDetails method
Also when starting server or checking for servers I receive errors regarding deprecated use of the function.
For example:
startServer()
Warning message:
startServer is deprecated.
Users in future can find the function in file.path(find.package("RSelenium"), "example/serverUtils").
The sourcing/starting of a Selenium Server is a users responsiblity.
Options include manually starting a server see vignette("RSelenium-basics", package = "RSelenium")
and running a docker container see vignette("RSelenium-docker", package = "RSelenium")