Unable to use chromedriver in Selenium after providing path of chrome driver - selenium-webdriver

import option is not displaying
I have provided the chromedriver path but I am unable import
"import org.openqa.selenium.chrome.ChromeDriver;" this command. Please provide a solution

You can't just set the path of ChromeDriver & start using it. The Chromedriver is an executable file used by Selenium's WebDriver to control chrome. So first you need to configure your project for Selenium.
Configure Eclipse with Selenium WebDriver is the best resource to setup Selenium on Eclipse.
Once your are done with the configuration, to correctly use ChromeDriver, use the statement:
WebDriver driver = new ChromeDriver();

You can use the Chrome driver like this by providing your Chrome driver path:
System.setProperty("webdriver.chrome.driver","C:\\chromedriver.exe");
WebDriver driver=new ChromeDriver();

You need to add selenium jars before you try to execute any selenium script. It seems you only added java jars.

Related

WebDriver Sampler: Error calling threadStarted java.lang.IllegalStateException: The process has not exited yet therefore no result is available

WDS.sampleResult.sampleStart()
var support_ui =
JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var wait = new support_ui.WebDriverWait(WDS.browser, 15000)
WDS.browser.get('http://jmeter-plugins.org')
var support_ui =
JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var wait = new support_ui.WebDriverWait(WDS.browser, 15000)
WDS.sampleResult.sampleEnd()
WDS.sampleResuilt.setSuccessful(true)
When I run those scripts in jmeter WebDriver Sampler, it open start twice the Chrome without typing url and throws errors in log Viewer panel:
I wonder why it does not work.
Looking into your log file it appears that you're using Selenium 2.47.0 which might not support your Chrome/ChromeDriver combination.
Looking into latest WebDriver Sampler plugin dependencies it is using Selenium Chrome Driver 2.52.0
Try upgrading your WebDriver plugin, the easiest way is doing this via JMeter Plugins Manager, and re-running your test. Also double check your code as there are repeating blocks and this line WDS.sampleResuilt.setSuccessful(true) is not syntactically correct.
The same code is perfectly working on my machine..
Make sure you have the latest version of Selenium Web Driver Support
Download and Jmeter-plugin manager and copy it to lib/ext directory of JMeter
Restart Jmeter to pick up plugin manager.
Now in Jmeter windows Click on Options --> Plugin Manager.. Install selenium web driver support (This will download Latest version of web driver support files)
Download latest version of ChromeDriver
Restart Jmeter to pick up latest plugins ..
IN JMeter give the path to chromedriver as shown below..
For more information of web driver sampler follow the below links
Web Driver sampler with Javascript
Web Driver sampler with Java
Please let me know if it resolved your issue..

Unable to launch Firefox browser using Selenium Webdriver

I am using Firefox version of 57.0 in my system, and for automation I am using selenium standalone server of 3.0.1 and gecko driver of 0.12.0. The below code is being used for invoking the firefox browser:
System.setProperty("webdriver.gecko.driver",properties.getProperty("GeckoDriverPath"));
driver = new FirefoxDriver();
But during execution after launching the browser it is not being navigated to the desired URL.
Please let me know if I have missed any steps.
Try to download the latest version geckodriver - https://github.com/mozilla/geckodriver/releases

Chrome Driver and selenium webdriver in protractor

I am using Google Chrome version 60. While configuring protractor, which Chrome driver and Selenium web-driver version should I use?
Thanks in advance.
Use latest one
ChromeDriver 2.32 from here
Selenium jar 3.5.1 from here

JMETER jp#gc - WebDriver Sampler

I would like to know how to run jmeter - webdriver sampler by using chrome browser. Is there any new plugins need to be downloaded for chrome? And this is my sample script to open in chrome browser,
WDS.sampleResult.sampleStart()
WDS.browser.get('http://jmeter-plugins.org')
WDS.sampleResult.sampleEnd()
And I have configured jp#gc - Chrome Driver Config config element in my test plan.
If you need to use Chrome browser you need to download ChromeDriver binary and drop it somewhere to your local disk.
Once done you need to specify the full path to the ChromeDriver executable under Chrome Driver Config like:
This way you should be able to integrate WebDriver and Chrome with JMeter.
See The WebDriver Sampler: Your Top 10 Questions Answered for the most commonly asked questions regarding the WebDriver sampler solutions.

Selenium Webdriver

I am using Selenium WebDriver 2.39.0 + Firefox 26.0.
My Firefox driver instantiate and I am successfully able to log in into my application.
After that my script is not able to perform any further actions. But the same is working fine on WebDriver 2.39.0 + IE 9.
Please suggest!
Error appears as below:
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', time: '2013-12-16 13:18:38'
can you use below code to initialize the firefox browser and give it a try:
FirefoxProfile firefoxProfile = new ProfilesIni().getProfile("default");
WebDriver driver = new FirefoxDriver(firefoxProfile);
Try updating Firefox. Just make sure that the version of WebDriver you have is compatible with the version of Firefox you have by going to the Selenium site.
Below are some of the configurations that works..
Please try
1) upgrading from Selenium 2.41.0 to 2.44.0 worked for me.
Using Firefox v33.1.1
2) Install Selenium 2.45 + FF 36.0.4 .the issue will be resolved
3) it works with selenuim 2.43 and firefox 32.0.3
4) selenium-java (2.45.0) with FF 34.0 works!
As per the log, browser is not interacting.Try to update your FF and selenium server as well.
I did have this error 2 days ago. The Firefox version is too new for the web-driver and is not compatible with each other, try installing an older version of Firefox. (I use Firefox version 36.0.1 with Selenium 2.48.2 and works perfect).
Selenium webdriver version and Firefox version should be in sync. Webdriver version is not compatible with latest version of Firefox. This is most common issue, try to install older version of Firefox. With new selenium 3.0 we won't see this issue. We use geckodriver. Hope this information helps.

Resources