What is the difference between Selenium Server and Selenium RC? - selenium

Selenium Webdriver - For interacting directly with browser
Selenium RC - Interacts with browser through a Server
If i need to test remotely using Web-driver, i need to use Selenium Server
So when we say Selenium Server in third point, does it mean then the
same server used by Selenium RC?
Is selenium server already included with selenium RC? If need to do automation using selenium RC, do i need to download Selenium Server separately?

Selenium Remote Control (RC) and Selenium WebDriver both are test automation tools supporting different programming languages but come with some critical differences.
Selenium RC
Till a couple of years back Selenium RC was an important component in the Selenium test suite. It was the testing framework that enabled a QA or a developer to write test cases in any programming language in order to automate UI tests for web applications against any HTTP website. Selenium RC comprised of two parts:
Client libraries for the preferred Language Binding Art.
A server that launches and destroys web browsers automatically.
Selenium RC’s architecture was a bit complicated as:
Developer/QA personal needed to install and launch a separate application called Selenium Remote Control Server before running test scripts.
The Selenium RC server acted as a mediator between the browser and Selenium commands.
The sequence of execution was:
The Selenium RC server injected a Javascript program known as Selenium Core into the browser client.
Once the Selenium Core program was injected, it started receiving instructions from the RC server based on test scripts. Selenium Core executed all these instructions as JavaScript commands.
The web browser executed all the commands given by Selenium Core and returns the test summary back to the Selenium RC server.
But there were limitations as follows:
Selenium RC Server's architecture was pretty complicated.
Execution of test scripts was time-consuming as Selenium RC uses JavaScript commands as instructions to the browser which resulted in slow performance.
API’s were less object-oriented.
There was no support for headless browsers.
All these limitations of Selenium RC Server led to the development of the new robust automation framework Selenium WebDriver.
WebDriver
From Selenium perspective, the WebDriver Interface is similar like a agreement which the 3rd party Browser Vendors like Mozilla, Chrome, Internet Explorer, Safari, etc have to adhere and implement the same. This would in-turn help the end-users to use the exposed APIs to write a common code and implement the functionalities across all the available Browsers without any change.
This usecase
To execute your testcases:
Locally: Selenium Client (jars) which is a bunch of API's would suffice your need.
On Remote machines(Selenium Grid): Selenium Server would solve your purpose.
You can find a relevant discussion in What is difference between Selenium Standalone Server and Java selenium Jar files

Related

Using OWASP ZAP Proxy for existing suite of Selenium tests

We have a suite of automated regression tests driven using Selenium for an Angular app with a .NET Core WEB API backend.
The intention is to include some automated security testing as part of our overnight build/test run.
From reading so far it looks like running ZAP as an intercepting proxy between Selenium and our web application is the way to go (see 'Proxy Regression/Unit Tests' in https://www.zaproxy.org/docs/api/#exploring-the-app) but I'm struggling to find clear documentation/examples.
What is the simplest way to achieve this using OWASP ZAP, and are there any definitive articles/examples available?
Start with the packaged full scan: https://www.zaproxy.org/docs/docker/full-scan/
Set the port and then proxy your selenium tests through ZAP. Use the -D parameter to pause ZAP until your tests have finished. For more ZAP automation options see https://www.zaproxy.org/docs/automate/

Dockerized webdriver testing for Microsoft Edge

I'm helping set up web testing frameworks for a team that runs web tests on a project that already supports Firefox and Chrome. They want to extend it to be able to test Microsoft Edge.
So far we've been using Selenium grid with Docker and Jenkins but only for Firefox and Chrome.
Is there a way to extend a set up like this for Microsoft Edge? Or is there a way to dockerize Micrsoft Edge testing?
I know there is a webdriver for Edge compatible with selenium grid but I've seen nothing about how to dockerize it.
I want to use Docker because it keeps all the Jenkins slaves clean and allows for controlled versions of browsers, and we can control multiple containers with Docker-Compose.
You can try to use WebDriver with Windows Insider to test web projects with MS Edge.
WebDriver is an emerging standard through which Web developers can write tests to automate Web browsers for site testing. It provides a programmable remote control for developing complex user scenarios and running them in an automated fashion against your website in a browser.
Reference:
Bringing automated testing to Microsoft Edge through WebDriver
Other useful links:
Automated browser testing on Microsoft Edge, Firefox and Chrome for free.
Free Testing on Microsoft Edge

Does selenium grid runs only Selenium command or also code chunk from different library

I have done my automation in Robotframework and I am using many libraries like Selenium2Library, Sikuli Library, HTTP Library, OS library and few more.
When I am running test on Selenium Grid, it invokes the browser on node and runs those steps which are from Selenium.
However, it does not run commands from Sikuli Library. Is selenium grid capable of running keywords from different libraries?
No, the selenium grid only works with selenium. The selenium grid is a server much like a web server. It listens for specific commands, and performs those commands. It will only respond to commands from selenium clients.
When using Sikuly in Robot Framework it is necessary to first setup the external sikuly server and then connect to it from Robot Framework. Typically this is a localhost connection, but connecting to an external host is also possible.
When using Selenium Grid, a connection is made to an anonymous node and thus the host to which the Sikuly server is runnning as well. Did a quick check in google and found that getting the hostname/IP of the running node from the hub is possible. Using the code example here I think it should be possible to create a direct connection to the Sikuly server.

What version of selenium should I install for SauceLabs or TestingBot?

I am planning to write Selenium tests for my application and want them to run on a wide variety of browsers and versions. I am also planning to use a virtualisation service such as SauceLabs or TestingBot.
However, as far as I can tell there are a number of different Selenium components such as:
Selenium WebDriver itself
Chrome Driver
InternetExplorer Driver
Opera Driver
Safari Driver
etc
Furthermore, I read in articles like https://support.saucelabs.com/customer/portal/articles/2005317-default-selenium-version-for-each-firefox-browser-version that you might be best advised to change the versions of these to get better compatibility depending on the version of the browser you are targeting.
I am confused as to whether I need to have different versions of Selenium and other components installed locally OR should I just have the latest version of Selenium WebDriver installed locally, SauceLabs/TestingBot will have specific versions on their VMs and the two will magically work together?
Thanks for any advice!
If you're executing on the cloud, be it Sauce, TestingBot, BrowserStack, etc., you won't need to have the Selenium server or any of the browser drivers installed locally.
That being said, however, I would advise keeping the standalone server along with chrome-driver and the IE driver (and/or any other browser drivers you need) installed locally for debugging tests under development. It's much easier while you're coding to run a test on your own machine and get it to the point where it's working as expected prior to committing. You can then use Sauce or whatever cloud hosted grid solution for your official test runs.
I typically just have the most recent versions installed locally, but this could be different for you based on your requirements. At work, I develop automated tests for internal applications. All of our users are all on the same pre-configured Windows image with the same browsers/versions. As such, I only need to worry about the supported platforms in my tests. If you're working with a public-facing application, you might consider referring to the supported browser/versions for the application. Juggling different versions of the same browser on a local machine can get pretty tedious, so even then, if I were in that situation, I'd likely configure my machine to the most common platforms and execute locally while in development, then use something like Sauce for executing on specific platforms. In short, I like to keep my local environment as clean and simple as possible, and let Sauce do the heavy lifting of managing all the different browser/version/os combinations for me.

webbacked selenium not supporting captureNetworkTraffic method

i am using webdriverbackedSelenium for my tests , i see that it isn't supporting capture network traffic method. can anyone tell me when webdriverbackedselenium is extending default selenium why isn't it supporting captureNetworkTraffic method
Selenium WebDriver and Selenium RC use fundamentally different mechanisms to automate the browser. RC installed itself as a proxy in some modes of operation, which allowed it to capture all communications between browser and web server. WebDriver's philosophy is designed to more closely emulate the user's experience, including not blindly installing a proxy without the user's knowledge, so WebDriver is not able to capture that traffic by default.
Selenium RC is deprecated, and has been for over two years. It is receiving no attention from the development team, and is unlikely to be improved in the future. However, since many people have significant investments in code using the RC API, the project provides a bridge class, WebDriverBackedSelenium. It is designed to allow you to migrate your RC code to WebDriver over time. It is not intended as a permanent solution. It does not, will not, cannot, and should not implement every single method of the Selenium RC API. It implements enough to allow your code to compile and mostly run, giving you the opportunity to change your code over to the WebDriver API.
If you absolutely require capturing network traffic to the browser using WebDriver, the API allows you to specify a proxy to use with the browser being automated. There are a number of proxies out there which allow you to capture, examine, and even modify the traffic to the browser. Some examples that people have used to good effect are BrowserMob proxy and Fiddler.