where chromedriver installed by Visual studio nuget - selenium

I am newbie and want help please.
I am trying on selenium to automate actions to a mobile webpage. (Don't care about landscape, but just reference to its code) I am referring to this post C# Selenium Mobile Emulation in landscape
ChromeDriverService service = ChromeDriverService.CreateDefaultService(#"C:\chromedriver");
I'm on windows7, using visual studio. I installed chromedriver through nuget package manager. I dont know what to replace on #"C:\chromedriver" as I don't know where chromedriver is on my machine.
Below is what I git diff from package.config, but does not seem help.
+
+
+
+
Any help is appreciated. Thank you very much.

If you look at
https://www.nuget.org/packages/Selenium.WebDriver.ChromeDriver/
Install Chrome Driver (Win32, macOS, and Linux64) for Selenium WebDriver into your Unit Test Project.
"chromedriver(.exe)" is copied to bin folder from package folder when the build process.
NuGet package restoring ready, and no need to commit "chromedriver(.exe)" binary into source code control repository.
So you should use
ChromeDriverService service = ChromeDriverService.CreateDefaultService(#"chromedriver.exe");

Related

Using Geb and the Edge WebDriver I get failed to create driver from callback

In my current automation project I am attempting to automate my testing based on various browsers using Gradle and Geb. I've been able to get all browsers working with the exception of Microsoft Edge. Currently I am seeing:
geb.driver.DriverCreationException: failed to create driver from
callback
I've verified that I am downloading the MicrosoftWebDriver.exe to the expected directory in my project but I am not sure if I am missing something in my driver setup:
driver = {
EdgeOptions options = new EdgeOptions()
options.pageLoadStrategy("eager")
edgeDriver = new EdgeDriver()
return edgeDriver
}
I am fairly new to Geb and Gradle as a whole so it is entirely possible I am missing something. Any help would be appreciated.
As far as I am aware You need more than just the exe to use the MS Webdriver. The machine that's executing the Webdriver code will need to have one of the following MSI's installed:
For Windows 10 Build 10240, install this version of Microsoft WebDriver.
For Windows 10 Fall 2015 Update, install Microsoft WebDriver Fall 2015 Update.
For the latest preview build from the Windows Insider Program, install this version of Microsoft WebDriver.
I think the MSI changes some switches in Edge to enable it to be controlled by Web driver.
Turns out that my issue was due to having just upgraded my local machine to Windows 10 and the Microsoft Web Driver preview build requires the Fall 2015 update which is unavailable to me for 31 days.

Is there a Selenium WebDriver available for the Microsoft Edge browser?

As of the date of this post the name "Microsoft Edge" has just been officially announced as the default browser for the new Windows 10.
It may be premature to ask but I would like to know if a new Selenium WebDriver is available for it and if not, if there is any telling how long we might expect to wait until we see one developed?
(A technical preview of Windows 10 has already been out so this doesn't seem like a foolish question to me.)
Yes, there is a WebDriver implementation for Microsoft Edge. Its initial availability was announced on 23 July 2015. Language bindings in the Selenium open source project have been updated to take advantage of this driver implementation, and those updates have been released in Selenium 2.47. Note that the Java language bindings were re-released as 2.47.1 to correct an initial issue. The initial implementation has limited functionality, but Microsoft is committed to bringing a fully functional driver implementation to fruition, so updates will be forthcoming.
Microsoft has provided MicrosoftWebDriver which can be used for Edge browser.
Correct version of MicrosoftWebDriver needs to be downloaded, based on the OS Build number
Go to Start > Settings > System > About and note down the OS Build number.
Download the proper version of the driver from this link - https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
If the file that's downloaded is .msi, then install it to get the .exe driver. For one of the release, direct .exe can be downloaded.
Once the MicrosoftWebDriver.exe is downloaded, we can use it in our test script using either System.setProperty("webdriver.edge.driver", "driver location") or using environment variable
The sample script would be like this -
System.setProperty("webdriver.edge.driver","C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe"); //put actual location
WebDriver driver = new EdgeDriver();
driver.get("your link");
Refer this article for detailed information - http://automationtestinghub.com/selenium-3-launch-microsoft-edge-with-microsoftwebdriver/
The Microsoft Edge driver for Selenium can be automatically downloaded (for Java) using the library webdrivermanager as follows:
EdgeDriverManager.getInstance().setup();
The variable webdriver.edge.driver is also exported by webdrivermanager with the proper path of MicrosoftWebDriver.exe.
"in case it wasn't clear, Microsoft Edge will have WebDriver support. It isn't available today, but is in development Q's? #msedgesummit" tweet from John Jansen the who is - "Microsoft Engineer. Principal Software Engineer (nee Test) Lead on Project Spartan (nee Internet Explorer)."
You can find him on twitter #thejohnjansen and wait for an announcement :)
Prerequisite: Windows 10 is installed on your machine
Download the specified Microsoft WebDriver server version for your build (In my case it is MicrosoftWebDriver.exe for the Operating System: Windows 10 Pro 64-bit (10.0, Build 14393))
Selenium WD Java code for MS Edge is as follows:
System.setProperty("webdriver.edge.driver", "D:\Ripon\MicrosoftWebDriver.exe");
driver = new EdgeDriver();
As of EdgeHTML version 18 (which arrived with Windows version 1809), there is no longer a standalone driver download. You can obtain the new driver in one of two ways:
Start - type "Manage optional features" - Click "Add a Feature" - Find "WebDriver"
Entering the following on an elevated command prompt - "DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0"
https://blogs.windows.com/msedgedev/2018/06/14/webdriver-w3c-recommendation-feature-on-demand/#Qj75uxuFHccPmCW5.97
Legacy versions are still available from:
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Update:
It appears that version 18 is now legacy and we are back to installing a separate webdriver since the move to Chromium. The link directly above this will still take you to the correct drivers page.
Thanks for your help, I was blocked with my tests, searching for a "EdgeDriver.exe" asked by the selenium EdgeDriver implementation and only find the MicrosoftWebDriver.
I have made this in C# if this can help someone, based on your previous answers :
First, you need to download the MicrosoftWebDriver nuget package, this one will only make a copy of the MicrosoftWebDriver.exe into your destination folder on compilation then
private readonly string _localDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Environment.SetEnvironmentVariable("webdriver.edge.driver", _localDir + "MicrosoftWebDriver.exe");
var driver = new EdgeDriver();
Hope this can help someone.

The playback engine could not find the binaries required to run cross browser coded UI test..." shows

After installing Selenium components for Coded UI Cross Browser Testing, and try to run test case on chrome, "System.Exception: The playback engine could not find the binaries required to run cross browser coded UI tests. This may be because the Selenium .NET bindings and Selenium Chrome driver are not installed or an older version of the Selenium Components Installer was used. For more information about installing the binaries, see http://go.microsoft.com/fwlink/?LinkID=267598" occurs. Can anyone help to resolve the issue? Thanks...
This can occur when the cross browser plugin has not installed correctly.
These are the manual steps to install the driver.
Download chrome driver from:
http://chromedriver.googlecode.com/files/
Download selenium dot net bindings from:
http://selenium.googlecode.com/files/
Right click on the downloaded zip files.
Select "properties".
Under "General" tab, click on the "Unblock" button.
Now unzip both the files and copy the contents to the following path (for the selenium-dotnet 2.29.1 binaries, copy the contents of net40 folder):
"%ProgramFiles%\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components" (for 32 bit machines)
"%ProgramFiles(x86)%\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components" (for 64 bit machines)
You need to Install Selenium components
On the Extensions menu, choose Manage Extensions.
In the Manage Extensions dialog box, search for Selenium components for Cross Browser Testing.
Highlight the extension and choose Download.

Timeout while trying to contact RemoteTestNG in Selenium on Mac

I have a TestNG setup running on Eclipse Indigo 20120216-1857 and TestNG for Eclipse v2.0. Dev environment is Mac OSX 10.8.2. Target is a web server running on Ubuntu 12.04.
Error: 'Couldn't contact the RemoteTestNG client. Make sure you don't have an older version of testng.jar on your class path.'
This error only happens when i'm running selenium scripts. not on my other api oriented test cases. I have selenium-server-standalone-2.25.0.jar running.
This same setup is working on my windows 7 dev environment.
This is a brand new eclipse setup and workspace on the mac.
I had met same question. I hope my resolved method can help you.
Method:
Please open Eclipse->Preferences->Then click TestNG->Restore Defaults
root reason: I had use ReportNG instead of testng default report,but after that I forgot to restore config. So when I make a new project,run as TestNG,but not add ReportNG jars, it report error.

Upgrading Selenium grid to 1.0.7

I have just been tasked with upgrading our build system to selenium grid 1.0.7 from 1.0.3. I did not create the original instance of our selenium grid.
My problem is this: our 1.0.3 installation has a windows service running that cruise control can use. In addition, there are extra folders in our selenium-grid-1.0.3 folders such as /bin /conf that do not exist in my selenium-grid-1.0.7 folder that I just downloaded. Does anyone know how I can somehow build selenium grid so that I can run it on our Windows server 2008 machine? I notice that our bin folder for 1.0.3 has a wrapper.exe in it that calls a wrapper.conf file in our 1.0.3/conf directory. I don't have either of those in my 1.0.7 folder and I'm assuming there is some other binary I must download, but have no idea where to get it from. Anyone know how I can get the selenium grid hub service to work with 1.0.7? Thanks.
Looks like the previous developer simply used Java Service Wrapper to create a service around the Selenium java files, thanks.