Selenium Testing - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Selenium Grid

Selenium Grid

shape Description

Selenium Grid innovation permits  to take a test and run it on various diverse machines that are a piece of this present grid. It is the same essential thought as Selenium Server. The main contrast is a system of servers. One of those servers will be the center, and the center point is going to coordinate everything that goes ahead inside of that Selenium Server system.

shape Conceptual figure

Selenium Remote Control is a take a look at apparatus that permitsthe developer to compose automated internet application UI tests in any programming dialect such as Java, Python, C++, etc..to make greater vital tests, as an example, perusing and composing documents and messaging test comes about. selenium internet driver is like extension to Selenium RC. Selenium Grid permits to run various occurrences of WebDriver in parallel.It makes every one of these hubs show up as a solitary occurrence, so tests don't need to stress over the real framework. Selenium Grid eliminates the time required to run Selenium tests to a small amount of the time that a solitary case of Selenium would take to run, and  it is easy to setup and utilize.

Starting Selenium Server

shape Description

So before running do anything with Selenium Server, need to download it and run the downloaded file. Presently Selenium Server is really a Java program, since Selenium was initially worked for Java. So it need Java Runtime Environment (JRE) - introduced in the event. Follow the below steps.

shape Step 1

Drive to this URL. Download Selenium
.

shape Step 2

Click on the version of the software that is 2.52.0 to install Selenium.

shape Step 3

When click on install button, one Jar file will be loaded in the downloads folder as below.

shape Step 4

To verify whether jar file is installed or not go to command prompt and enter "Java".

Running a test

shape Description

"I WebDriver" driver equivalents new Remote Web Driver will be used. Also, two things  will determine here. The first is the location of  remote Selenium Server and  the second is the abilities that are required.

shape Examples

 Adding Windows/IE node to Selenium Hub: add hubs to the Selenium Hub, for running tests in parallel. It is prescribed to test  web applications with real OS stages .

shape Step 1

Enter the below code. [java] public static void main(String[] args) "class": "org.openqa.grid.common.RegistrationRequest", "capabilities": { "seleniumProtocol": "WebDriver", "browserName": "Internet Explorer", "version": "12", "maxInstances": 1, "platform" : "WINDOWS" } ], "configuration": { "port": 8989, "register": true, "host": "192.168.1.100", "proxy": "org.openqa.grid.selenium.proxy. DefaultRemoteProxy; "maxSession": 2, "hubHost": "192.168.1.100", "role": "webdriver", "registerCycle": 5000, "hub": "http://192.168.1.100:4444/grid/register", "hubPort": 4444, "remoteHost": "http://192.168.1.101:8989" } } [/java] The org.openqa.grid.common.RegistrationRequest is nothing but license version of the software and make sure to install web driver only why because remote control is no longer used, port number is mandatory to provide the communication between the two applications, the default port number is 4444. Proxy is a software to provide the communication between the end point devices. While working with Eclipse localhost will be used to connect to an application.

shape Step 2

An occasion of Selenium Standalone Server is dispatched with WebDriver convention on the port determined in the design; in this sample hub, begin running on http://192.168.1.101:8989. After a fruitful begin, the hub registers itself to the Hub. On the off chance that explore to the Grid'sconsole on the center point, that is, http://localhost:4444/framework/console.

Adding Firefox node to Selenium Hub

shape Description

Like Windows and Internet Explorer, a hub for Mac OS X and Firefox can be added to the Hub. Follow the steps one by one.

shape Step 1

In another way a hub can be included by making an arrangement document in JSON group and afterward utilizing the order. [java] { "class": "org.openqa.grid.common.RegistrationRequest", "capabilities": [ { "seleniumProtocol": "WebDriver", "browserName": "firefox", "version": "9.0.1", "maxInstances": 1, "platform" : "MAC" } ], "configuration": { "port": 8989, "register": true, "host": "192.168.1.100", "proxy": "org.openqa.grid.selenium.proxy. "DefaultRemoteProxy", "maxSession": 2, "hubHost": "192.168.1.100", "role": "webdriver", "registerCycle": 5000, "hub": "http://192.168.1.100:4444/grid/register", "hubPort": 4444, "remoteHost": "http://192.168.1.102:8989" } } [/java]

shape Step 2

After a fruitful begin, the hub registers itself to the Hub. Explore to Grid's console on the Hub. A passage for Firefox will show up in the rundown of accessible hubs alongside the Internet Explorer hub included.

Summary

shape Key Points

  • Virtualization and cloud-based foundation can likewise be utilized to scale the test mechanization.
  • Executing tests in parallel, diminishing expenses, and expanding rate and scope.
  • An advantage of a proxy server is that its cache can serve all users