Daily Bytes : Good to follow

  • Be Organize. It’s advisable and good, to have To-Do List when you about to start a day at workplace.
  • Always be in proper communication with your team members, seniors and Client as well.
  • Show your confidence to Seniors and  share your thoughts to team members.
  • Always Coney your point of view in a proper manner in any discussion.
  • It’s obvious to forgot, but it’s prudent to take notes while you are in meeting/session/wherever required.
  • Always ask/write email  and take confirmation, if you are not sure about communication which happened recently.
  • First listen properly and understand when you are in any professional communication.
  • Always Speak up and it is good to use facts, proofs in the conversation.

Read Similar Posts

Selenium Grid Tutorial: Writing first script for Grid using RemoteWebDriver

In previous posts, We have seen how to set up hub and nodes. But still we have not seen how to run your code on some remote machines.But code execution on remote machine could not be possible without RemoteWebDriver. But before moving ahead we need to cast our focus on this RemoteWebDriver.

\  This is implementation class of WebDriver interface which is plays a key role in script execution on some remote machine.RemoteWebDriver is divided in two parts
1- RemoteWebDriver Server
2- RemoteWebDriver Client

RemoteWebDriver Server : This part listen all the request on certain port from all the RemoteWebdriver client and on the basis of these request it approach Firefox, Chrome or IR driver to fulfill client request. So here when we run this command

we try to start the remote server.

RemoteWebDriver Client :  All the language binding works as RemoteWebDriver client which comes in to action when we try to execute any script. These client first try to translate all the information related to code execution in JSON formate and send it to remoteWebdriver server using JSON wire protocol and then server talks to all the drivers available as per the request.

So now you are familiar with the concept of RemoteWebDriver but how it servers your purpose.
IT Certification Category (English)728x90

As you have already seen that RemoteWebDriver is implementation class of WebDriver and in your Selenium WebDriver script you always create a driver instance that talk to respective browser as per our code. In the same fashion you need to create instance of WebDriver like this

where URL is nothing but the it is URL of Hub that we have used in previous post like
Selenium Grid Commandso here URL would be (as per above image)
Capabilities is nothing but used to provide information about the configuration which contains type of browser, version and also provide information about platform where script should be executed remotely.So lets see how to it is being used , Suppose you want to execute your code on firefox with version 40.0 and want to run this test on node machine which is Windows
So Capability would be written like this

So these are two important component of script that are going to be executed on remote machine using Grid concept.

So lets write the complete code that runs on Selenium Grid.

1- Start the hub and node.
2- Write the code
Scenario :
a) Open the firefox browser on remote machine(Node)
b) Navigate to Google and enter string “Selenium Grid Tutorial”  in search box

So create one class GridExampleTest in your eclipse  under package pack1 and past the following code

3- Now run the code.

Above code will execute complete scenario on Windows machine with Firefox browser with version 40.0.
IT Certification Category (English)728x90

This was the first code that will be used for grid example. In coming post you will see how you can run your script on multiple machines at the same time and would see how parallel execution of test cases are possible with Selenium Grid.

Read Similar Posts

Selenium Grid Tutorial: running hub and nodes using json

This post is just the continuation of last two post

  1. Selenium Grid Tutorial : Setting up hub and node
  2. IT Certification Category (English)728x90

  3. Playing with node registration parameters in grid

In these two post we have learn how to launch hub and node using command line and have also seen how to use parameters efficiently.But in this post we are going to see how to use json files to run your hub and nodes.

1- We need to create json file for hub and node. Now we are going to see the json that is needed for hub.
a) Open any text editor like notepad or textedit.
b) Past content in editor from JSON for Hub code block.
c) Save this with hub.json in same place where you have your selenium-server-standalone jar file
JSON for Hub

you can fine it at this place .

In the same fashion we can create json file for node and this would look like this, In this we are going to give value for browserName, version and platform as well in this json file and will save it as node.json
JSON for node

above json has been divided in two part first part takes all the parameter that we can set using desiredcapabilities for any browser and second section contains all the configuration related stuff.

IT Certification Category (English)728x90

2- Once we are done with hub and node json file creation.Follow the following steps to run hub and node

1- Open CMD/terminal, navigate to the place where selenium-server-standalone jar is present.
2- Type following command

and hit enter it will start your hub and to check this go to http://localhost:444/grid/console.

Selenium grid console

So if you have gone through previous post then you would come to know that -hubConfig is new parameter that is being followed by the json file that has been created for hub.

1- As we have seen in case of hub, we need to open cmd/terminal and need to navigate to location of selenium-server-standalone jar
2- Run following command

above command would register node with hub and all browser instances and session detail would be present in node.json.

This can be seen on http://localhost:4444/grid/console

Selenium Grid Console with port parameter




Read Similar Posts

1 2 3 4 5 44