Difference between selenium-support and selenium-java jars - selenium

I'm confused about the use of the selenium-support jar file.
There is another achieve available called selenium-java.jar, which is selenium java binding.
Where I can use selenium-support jar?

If you are using Maven generally you want to have your project dependant only on selenium-java. selenium-support is one of the dependencies of that. Maven will resolve these dependencies for you.
If you are just using a plain project, then linking to selenium-standalone will contain all these in one package.
Additional information can be found in the official documentation.

Selenium Support:
Selenium is a set of different software tools each with a different approach to supporting browser automation. These tools are highly flexible, allowing many options for locating and manipulating elements within a browser, and one of its key features is the support for automating multiple browser platforms. This package contains .NET support utilites and classes that users may find useful in using Selenium WebDriver. These support classes are mainly intended to spark ideas of what is possible with Selenium WebDriver, and may not be entirely appropriate for production use.
Selenium Java Jars:
Selenium Standalone Server - is a java jar file which is used for starting selenium server which is as word say server, proxy to selenium grid for browsers you want to automate

Related

What is Browser Binary Manager how to use it for Selenium

I came to know recently that using 'WebDriver Binaries' manager is a good practice in Automation projects.
But not sure what is this and how to use?
Did some google searches also and got quite a lot posts around how to manage binaries; but not on why to use.
So it will be great if someone can guide on it with its benefits.
Finally Got to know about it some time back as below, thought it might be useful for other hence posting it as self Answer.
As an automation engineer, we always have to set the path for the browser binary, for this first, we need to download a binary file[driver.exe] which allows WebDriver to handle browsers. In addition, the absolute path to this binary must be set as JVM properties, as follows:
System.setProperty("webdriver.chrome.driver", "Your path to/chromedriver");
System.setProperty("webdriver.gecko.driver", "Your path/geckodriver");
Its just not about the downloading and setting properties to set the binary path but you also need to change the binaries frequently as the browser version or Selenium version changes.
I found this solution and implemented it- and That's All!
Now I don't need exe libraries anymore for the browsers!
A small maven repository made life easy.
How it works:
When working on a Maven project, you just need to add a dependency called WebDriverManager. This library will take care of everything your browser version and driver.
In order to use WebDriverManager in a Maven project, you just need to add the following dependency in your pom.xml:
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>3.3.0</version>
</dependency>
WebDriverManager actually gets your browser version and downloads the compatible browser binary by itself to make you run your code without interruption.
Now, rather than setting the browser binaries, you just need to add below line of code in your browser manager class and that's it.
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
You're done!
The line WebDriverManager.chromedriver().setup(), does all magic for you:
It checks for the latest version of the WebDriver binary.
It downloads the WebDriver binary if it's not present on your system.
It exports the required WebDriver Java environment variables needed by Selenium.
Reference:
https://github.com/bonigarcia/webdrivermanager#webdrivermanager-as-java-dependency
When you say WebDriver binaries, I am assuming that you are talking about the WebDriver bindings or the libraries. With out adding the WebDriver binding's into your project you can't really do anything with the WebDriver interface, like you can't invoke any browser or drive any website. Either you can manually add them into your project build path or you can use any dependency management tool like Maven for getting all the WebDriver libraries into your project. You can then use them.
You can either just add the standalone server file, which would do the same job as WebdDriver bindings.
There are Third Party Driver's which we use for each of the bowser's like, chrome - chromedriver.exe, firefox - geckodriver.exe ..etc ---These are also called as WebDriver binarie's(mostly refereed as driver files).

Porting part of Selenium IDE to chrome extension

I have been trying to port Selenium IDE into a chrome extension I have been working on but to no avail. Specifically, I want to be able to execute selenium-built commands (e.g. click, assertElementVisible, etc.) in my extension.
I am aware that porting Selenium into another extension has been done before (Katalon Recorder), but I could find absolutely nothing online on how the porting was done.
That said, can anyone give me some pointers on:
Specifically what files I should port from the IDE repository
How to set up and call Selenium commands in my extension
How I may properly accredit Selenium in my use of its code
I am aware that the old Selenium IDE is deprecated, so I plan on using the new Selenium IDE on github. The new IDE is still under development, but I believe that the functionalities that I require are ready to be used at this moment (I only require running commands on DOM elements).

Is there a way to run a specific version of a browser in a sandboxed fashion when using WebDriver?

At the moment, it is possible to run the same test on different browser assuming that you have all those browsers installed on your machine and that those browsers have a version compatible with your drivers version.
Is there a way, such as a library or everything else, that allows us to run the same test on different versions of the same browser, downloading those browsers on demand (bit like WebDriverManager does with the drivers)?
We want a test harness runnable on every machine and every operating system and we don't want to rely on any browser already installed in that machine.
A tool that allows us to choose on what browser and what version we want to run the test, it downloads a sandboxed or virtual version of that browser, and it runs the test.
I heard also about Saucelabs, but the systems under test are not available by publicly available URLs because they are in a dev environment.
I thought we could use Docker, but in that case we have to use a Headless browser, and we want to keep to possibility to see what the test is actually doing.
Thanks in advance.
No longer do you need (as we did in the dark old days) to manage our own infrastructure and have machines running instances of browsers and configure a Selenium Grid.
SauceLabs is a Selenium Grid in the cloud and is most definitely the recommended approach here. They offer a wide (ever growing) array of platforms.
With all that infrastructure taken care for you in the cloud the problem changes to one of correctly providing SauceLabs the DesiredCapabilities
I would highly recommend you also use Jenkins and its Sauce OnDemand plugin which allows you to select your target environments and at the same time integrate cross device testing into your build pipeline.
Constructing the DesiredCapabilities objects for SauceLabs in your test code is not a straightforward exercise however and can lead to hard to maintain spaghetti code if not done with a lot of discipline.
There are some NuGet packages that solve the SauceLabs DesiredCapabilities problem and integrates with Jenkins as well.
Saucery2 for NUnit2 (NuGet, Source, Example)
Saucery3 for NUnit3 (NuGet, Source, Examples)
SauceryJ for JUnit4 (Source, Example)
Saucery is DesiredCapability factory for SauceLabs. Full disclosure: I wrote Saucery and maintain it.
Saucery pulls in all the dependencies you would want allowing you to write tests against:
Desktop browsers (simply extend SauceryBase)
with Selenium;
or native app tests against:
IOS (simply extend SauceryIOSBase); or
Android (simply extend SauceryAndroidBase) devices
with Appium.
The home page provides benefits and a How To.

Help with Selenium Webdriver download?

I have Selenium IDE and i want to install Selenium Webdriver.
1) Can anyone tell me where can i download selenium webdriver. i don't see any link available in the documentation.
2)Can i use selenium webdriver with PHPUnit? I see some materials saying php is not supported in selenium 2 however there are some download links available for phpbindings for webdriver what is this exactly?
3)If i have Selenium webdriver do i still need selenium server to run test cases in different browsers?
I would appreciate your answers...
I completely agree with you. They have a ton of documentation, but they do a horrible job of explaining what you actually need. It took me about 2 days to put all the pieces together. You will need a few things...
If you are running tests with C#, download NUnit, C# client drivers. Create a class library project in Visual Studio and reference the dlls (assemblies) for NUnit (for appropriate dotnet version) and the C# client drivers. Compile your class library. It should create a dll inside of the bin\Debug directory. Then go into NUnit, create a project, and then open your assembly in that bin\Debug directory. That should get you started.
If you're developing using Java, download JUnit (not NUnit) and then download the Java Client Drivers, and use Eclipse instead of Visual Studio. You can launch JUnit right from Eclipse.
I've only tried NUnit and JUnit before. But I'm sure PHPUnit can also be launched from Eclipse (educated guess). There seems to be the most documentation for Java and Python.. from experience, but I've been doing everything in .NET and I haven't had anything I couldn't solve.
The Unit Testing software isn't required, but the code the format add-ins for Firefox Selenium IDE will build the code for NUnit (C#) or JUnit (Java), etc... so most use those tools.
If you want to get some boilerplate code, go into Selenium IDE and turn on experimental features under options. Then export your C# code (or Java code) from the format menu after you've recorded your commands. It won't all convert 100%, so be aware of that. Just google from there to get questions answered.
One thing to watch out for... clickAndWait commands won't convert to click and wait in the code. You will either need to do an implicit wait or a thread.sleep wait after certain commands before you'll be able to access the next element if you're waiting for an action to occur. You will also want to turn on native events so you can fire certain JavaScript events. Your fire events won't work if the driver doesn't have this turned on. The WebDriver driver.
If you have any other questions, let me know.
You can download Selenium server as well as client driver from the following:
http://code.google.com/p/selenium/downloads/list
You can download "php-webdriver-bindings-0.9.0.zip" from the following source:
http://code.google.com/p/php-webdriver-bindings/downloads/detail?name=php-webdriver-bindings-0.9.0.zip
In C# context:
Now the better way of including packages in C# project is using nuGet. nuGet is packaging utility which when executed from its powershell command window, quickly downloads the dll files and links them to project. Below link details on how to use nUGet to install packages of selenium webdriver, selenium support and nUnit.
How to invoke/run different type of web driver browser using remote webdriver in C#

Finding a suitable version of Selenium (automated testing tool)

My project is compatible only with Internet Explorer. I want the test scripts to get generated automatically as it is done in Selenium IDE.Can i use selenium RC to test my application?
I could not use selenium IDE as it can be used only with Mozilla Firefox.
Can you suggest any other free tools for my project.
thanks in advance ...
I think if you dig around for earlier versions of selenium they are compatible with IE. We use it here for front-end automation via IE6 anyway