When running my test not using RemoteWebDriver, just using IWebdriver driver = new FireFoxDriver();
I can run my tests fine, finding elements, using XPath expressions works fine, but when I switch my settings to using RemoteWebDriver, I get an error for a certain part during my test.
I recieve the following error message:
Attempting to find outbound radio input to click
2012-01-18 15:50:11,522 [Simple Test Driver] INFO SeleniumGridExample.Utils.EventLogger - The driver is a SeleniumGridExample.Utils.ScreenshotRemoteWebDriver
2012-01-18 15:50:11,522 [Simple Test Driver] INFO SeleniumGridExample.Utils.EventLogger - Screenshot saved with exception: Session [1326893314795] not available - []
2012-01-18 15:50:11,522 [Simple Test Driver] INFO SeleniumGridExample.Utils.EventLogger - The driver is a SeleniumGridExample.Utils.ScreenshotRemoteWebDriver
2012-01-18 15:50:11,522 [Simple Test Driver] ERROR SeleniumGridExample.Utils.EventLogger - Screenshot could not be saved: Unexpected error.
<html>
<head>
<title>Error 501 Method {"USING":"XPATH","VALUE":"//INPUT[CONTAINS(#ID, is not defined in RFC 2068 and is not supported by the Servlet API </title>
</head>
<body>
<h2>HTTP ERROR: 501</h2><pre>Method {"USING":"XPATH","VALUE":"//INPUT[CONTAINS(#ID, is not defined in RFC 2068 and is not supported by the Servlet API </pre>
<p>RequestURI='0_lsDirection_ctrl0_lsLegs_ctrl0_inpSelect')]"}GET /wd/hub/session/1326893314795/screenshot</p>
<p>
<i><small>
Powered by Jetty://
</small>
</i>
</p>
</body>
</html>
Does anyone here know why I get this issue using RemoteWebDriver but not when using the normal IWebDriver driver = new FireFoxDriver();
try using //INPUT[#id=''] . This must work. But better try to use css selectors. Selenium takes some time using expath selectors on IE browsers.
Related
I am using WebDriverManager api to initiate browser. I am using the following code to connect to chrome browser.
WebDriverManager.chromedriver().setup()
Exception is:
io.github.bonigarcia.wdm.config.WebDriverManagerException: java.security.KeyStoreException: problem accessing trust storejava.io.IOException: Invalid keystore format
at io.github.bonigarcia.wdm.online.HttpClient.<init>(HttpClient.java:117)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:490)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:277)
Caused by: java.security.KeyStoreException: problem accessing trust storejava.io.IOException: Invalid keystore format
at sun.security.ssl.TrustManagerFactoryImpl.engineInit(TrustManagerFactoryImpl.java:74)
at javax.net.ssl.TrustManagerFactory.init(TrustManagerFactory.java:250)
at org.apache.hc.core5.ssl.SSLContextBuilder.loadTrustMaterial(SSLContextBuilder.java:201)
at io.github.bonigarcia.wdm.online.HttpClient.<init>(HttpClient.java:99)
Anyone has any idea about this.
WebDriverManager version 4.0.0
ChromeBrowser 83
selenium version : 3.14.0
I am trying to integrate my robotframework test with saucelabs. I just used open browser keyword and passed the remote url and desired capabilities values.
Open Browser https://saucelabs.com/ ie remote_url=${REMOTE_URL} desired_capabilities=browserName:internet explorer,version:9.0,platform:Windows 7
Got the below error
Opening browser 'ie' to base url 'https://saucelabs.com/' through
remote server at 'desired_capabilities=browserName:internet
explorer,version:9.0,platform:Windows 7' failed [ WARN ] Can't take
screenshot. No open browser found | FAIL |
java.net.MalformedURLException: no protocol:
desired_capabilities=browserName:internet
explorer,version:9.0,platform:Windows 7
I tried to pass the desired capabilities in different format and got the same error. This framework is set up in eclipse using jython.
Open Browser https://saucelabs.com/ browserName=ie remoteUrl=${REMOTE_URL} desiredCapabilities=platform:Windows 7,browserName:internet explorer,version:9.0,username:${username},accessKey:${accessKey}
Define/pass the values of the variables before using the above statement.
I am doing
WDS.AddExtension(Path.GetFullPath("Ghostery_v5.4.1.crx"));
I know its wrong Please let me know in jmeter how to add chromedriver extension in chrome profile
Stacktrace in jmeter
2015/01/27 12:03:52 INFO - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: Current thread name: 'xxxxx1-1', has browser: 'ChromeDriver: chrome on XP (606ce1d4c34688e1062579fd676f16a7)'
2015/01/27 12:03:52 ERROR - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: sun.org.mozilla.javascript.internal.EcmaError: TypeError: Cannot find function AddExtension in object com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverScriptable#3a0ee49f. (<Unknown source>#1) in <Unknown source> at line number 1
xxxx
I am not sure how to work with JMeter and webdriver but in webdriver it is fairly as simple as
var chromeOptions = new ChromeOptions();
chromeOptions.AddExtension("something.crx");
I've got a really perplexing problem in JMeter. I'm building a REST webservice regression test plan, and the GETs POSTs and DELETEs are working well. Unfortunately, whenever I attempt a PUT, I'm getting the error
java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
Stack trace:
2013/01/04 13:18:18 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sendEntityData(HTTPHC4Impl.java:1023)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:281)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1075)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1064)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:426)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
at java.lang.Thread.run(Thread.java:680)
I've tried a number of things: I added a content type to the Content encoding field, tried commenting out this line in the test plan:
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
But none of it is working. This is the request I'm making (sanitised):
URL: ${PATH_TO_SERVICE}/${ID}/category/${CAT_ID}
BODY:
{
"id":"xxxxxxx",
"name":"AUTOREGRESSION",
"icon":"HOME",
"Key" :"99949"
}
HEADERS:
Content-Type : application/json
Accept : application/json
Has anyone seen this before?
Thanks.
Are you sure you are using a standard JMeter 2.8 or did you change some jars ?
This error is mentionned here:
https://issues.apache.org/jira/browse/HTTPASYNC-21
Can you open a bug in JMeter bugzilla with a simple Test Plan showing issue ?
You can also try JMeter nightly build which contains more recent versions of HttpComponents:
http://jmeter.apache.org/nightly.html (read carefully Building JMeter )
How to run webdriver tests in Selenium Grid linux and firefox. After setting up the selenium Grid and registering the node with the hub when i try to run the below code throws class not found error, any thoughts.
URL server = new URL("http://127.0.0.1:4444/wd/hub");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setBrowserName("firefox");
System.out.println("Connecting to " + server);
RemoteWebDriver driver = new RemoteWebDriver(server, capabilities);
driver.get("http://www.google.com");
driver.quit();
Satish, check the error in stack trace. It says
Caused by: java.lang.ClassNotFoundException: com.app.tests.RemoteTest
This is NOT a selenium exception. Your class file RemoteTest is not in the classpath.You need to set it in the classpath.
You could try:
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
I assume Firefox is installed correctly and your node has a matching firefox instance?
Could you post your config files?