{"id":51020,"date":"2017-10-11T11:00:14","date_gmt":"2017-10-11T08:00:14","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=51020"},"modified":"2019-03-20T13:44:33","modified_gmt":"2019-03-20T11:44:33","slug":"selenium-grid-junit-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/","title":{"rendered":"JUnit Selenium Grid Example"},"content":{"rendered":"<h2>1. Introduction<\/h2>\n<p>In this example, we will explore the functionality of Selenium Grid and we will understand it&#8217;s significance. We will create a Page Object and then we will access that page object from test cases using JUnit. The example will cover the gmail login where we will be invoking the url in node and hub using test cases in JUnit.<\/p>\n<p><figure id=\"attachment_51021\" aria-describedby=\"caption-attachment-51021\" style=\"width: 797px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Screen-Shot-2017-10-01-at-4.16.46-PM.png\"><img decoding=\"async\" class=\"wp-image-51021 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Screen-Shot-2017-10-01-at-4.16.46-PM.png\" alt=\"\" width=\"797\" height=\"453\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Screen-Shot-2017-10-01-at-4.16.46-PM.png 797w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Screen-Shot-2017-10-01-at-4.16.46-PM-300x171.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Screen-Shot-2017-10-01-at-4.16.46-PM-768x437.png 768w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/a><figcaption id=\"caption-attachment-51021\" class=\"wp-caption-text\">Selenium Hub and Selenium Node<\/figcaption><\/figure><\/p>\n<p><strong>Environment of the Project:<\/strong><\/p>\n<ul>\n<li>Selenium Grid 3.6.0<\/li>\n<li>Maven 4.0<\/li>\n<li>JUnit<\/li>\n<li>JDK 1.8<\/li>\n<li>Mac OS Sierra<\/li>\n<li>Eclipse: Neon Release (4.6.0)<\/li>\n<\/ul>\n<h2>2. Selenium Grid<\/h2>\n<p>Selenium Grid allows to run test cases on different machines against browsers in parallel. That is, running multiple test cases at the same time against different machines that are running different browsers and operating systems. Importantly, Selenium-Grid allows distributed test execution.<\/p>\n<h2>3. Why Selenium Grid<\/h2>\n<ul>\n<li>To run different test cases in different browsers, different version of browsers and browsers running in different operating system.<\/li>\n<li>To reduce the time of testing the test suites. The Selenium Grid consists of a single Hub and one or more Nodes. Hub is the central unit as it receives all the tests to be executed along with the information about type of browsers, platforms (operating systems) where the test has to be run. The nodes are then connected to Hub to receive the requests. Thus, the node runs the browser and execute the test cases.<\/li>\n<\/ul>\n<h3>3.1 Configuring Selenium Hub<\/h3>\n<p>In order to configure the Selenium Hub in your PC, you\u2019ll need to download the Selenium standalone server. You can download it from <a href=\"http:\/\/www.seleniumhq.org\/download\/\">http:\/\/www.seleniumhq.org\/download\/<\/a> .<\/p>\n<p>Then, navigate to the folder where is downloaded. To register the hub type the command:<br \/>\n<code> java \u2013jar selenium-server-standalone -3.6.0.jar \u2013role hub <\/code><\/p>\n<p>By default, Selenium server runs on 4444 port. In order to configure it to another port just change the port to the desired port by typing:<br \/>\n<code>java -jar selenium-server-standalone-2.53.1.jar -role hub -port{desired_port}<\/code><\/p>\n<p><figure id=\"attachment_51022\" aria-describedby=\"caption-attachment-51022\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhub.jpeg\"><img decoding=\"async\" class=\"wp-image-51022 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhub.jpeg\" alt=\"\" width=\"800\" height=\"177\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhub.jpeg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhub-300x66.jpeg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhub-768x170.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-51022\" class=\"wp-caption-text\">Grid Hub<\/figcaption><\/figure><\/p>\n<p>To check if the hub has been registered, login to local host <code>http:\/\/localhost:4444\/grid\/console<\/code><\/p>\n<p>Verify that you see the Grid console with the version similar to the one below. In my case, I am using 3.6.0 version.<\/p>\n<p><figure id=\"attachment_51023\" aria-describedby=\"caption-attachment-51023\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhubconsole.jpeg\"><img decoding=\"async\" class=\"wp-image-51023 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhubconsole.jpeg\" alt=\"\" width=\"800\" height=\"250\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhubconsole.jpeg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhubconsole-300x94.jpeg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridhubconsole-768x240.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-51023\" class=\"wp-caption-text\">Grid Hub Console<\/figcaption><\/figure><\/p>\n<h3>3.2 Configuring Selenium Node<\/h3>\n<p>Navigate to the folder that contains the Selenium standalone server and then use the command:<br \/>\n<code> java -jar selenium-server-standalone-3.6.0.jar -role webdriver -hub http:\/\/192.168.1.102:4444\/grid\/register<\/code><\/p>\n<p>By default, the node will connect to hub at 5555 port, unless is specified with the desired port. In order to specify a port, just add <code>-port<\/code> value after registration:<br \/>\n<code> java -jar selenium-server-standalone-3.6.0.jar -role webdriver -hub http:\/\/192.168.1.102:4444\/grid\/register -{desire_port} <\/code><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Similarly, you can use the same command to add another node. Selenium Grid can support up to parallel execution of web drivers in 5 different nodes.<\/p>\n<p><figure id=\"attachment_51025\" aria-describedby=\"caption-attachment-51025\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/node.jpeg\"><img decoding=\"async\" class=\"wp-image-51025 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/node.jpeg\" alt=\"\" width=\"800\" height=\"377\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/node.jpeg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/node-300x141.jpeg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/node-768x362.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-51025\" class=\"wp-caption-text\">Node Command<\/figcaption><\/figure><\/p>\n<p>Then, navigate to <code>http:\/\/localhost:4444\/grid\/console<\/code> and confirm that the browsers are like below:<\/p>\n<p><figure id=\"attachment_51026\" aria-describedby=\"caption-attachment-51026\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/nodeconsole.jpeg\"><img decoding=\"async\" class=\"wp-image-51026 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/nodeconsole.jpeg\" alt=\"\" width=\"800\" height=\"296\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/nodeconsole.jpeg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/nodeconsole-300x111.jpeg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/nodeconsole-768x284.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-51026\" class=\"wp-caption-text\">Grid Console<\/figcaption><\/figure><\/p>\n<p>You can try using the port of the individual node on the browser to see if the node is active and running:<br \/>\n<code> http:\/\/localhost:5555<\/code><\/p>\n<p><figure id=\"attachment_51024\" aria-describedby=\"caption-attachment-51024\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridnode.jpeg\"><img decoding=\"async\" class=\"wp-image-51024 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridnode.jpeg\" alt=\"\" width=\"800\" height=\"292\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridnode.jpeg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridnode-300x110.jpeg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/gridnode-768x280.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-51024\" class=\"wp-caption-text\">Grid Node<\/figcaption><\/figure><\/p>\n<h2>4. Getting Started with the Project<\/h2>\n<p>We will be using Maven archetype to configure the Selenium Project.&nbsp;Create a Maven project and select the <em>Group Id<\/em> and <em>Artifact Id<\/em> for Selenium as shown in the picture below. Simply click on New &gt; Maven &gt; Maven Project and then type \u201cSelenium\u201d. You can also use classic way by adding the following dependency in pom.xml.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\"> &lt;dependencies&gt;\n &lt;dependency&gt;\n       &lt;groupId&gt;junit &lt;\/groupId&gt;\n       &lt;artifactId&gt;junit &lt;\/artifactId&gt;\n       &lt;version&gt;4.11 &lt;\/version&gt;\n     &lt;\/dependency&gt;\n     &lt;dependency&gt;\n       &lt;groupId&gt;org.seleniumhq.selenium &lt;\/groupId&gt;\n       &lt;artifactId&gt;selenium-java &lt;\/artifactId&gt;\n       &lt;version&gt;2.40.0 &lt;\/version&gt;\n     &lt;\/dependency&gt;\n     &lt;dependency&gt;\n       &lt;groupId&gt;com.opera &lt;\/groupId&gt;\n       &lt;artifactId&gt;operadriver &lt;\/artifactId&gt;\n       &lt;version&gt;1.5 &lt;\/version&gt;\n     &lt;\/dependency&gt;\n     &lt;dependency&gt;\n       &lt;groupId&gt;com.github.detro.ghostdriver &lt;\/groupId&gt;\n       &lt;artifactId&gt;phantomjsdriver &lt;\/artifactId&gt;\n       &lt;version&gt;1.1.0 &lt;\/version&gt;\n       &lt;exclusions&gt;\n         &lt;exclusion&gt;\n           &lt;groupId&gt;org.seleniumhq.selenium &lt;\/groupId&gt;\n           &lt;artifactId&gt;selenium-remote-driver &lt;\/artifactId&gt;\n         &lt;\/exclusion&gt;\n         &lt;exclusion&gt;\n           &lt;groupId&gt;org.seleniumhq.selenium &lt;\/groupId&gt;\n           &lt;artifactId&gt;selenium-server &lt;\/artifactId&gt;\n         &lt;\/exclusion&gt;\n       &lt;\/exclusions&gt;\n     &lt;\/dependency&gt;\n     &lt;dependency&gt;\n       &lt;groupId&gt;ru.stqa.selenium &lt;\/groupId&gt;\n       &lt;artifactId&gt;webdriver-factory &lt;\/artifactId&gt;\n       &lt;version&gt;1.0 &lt;\/version&gt;\n     &lt;\/dependency&gt;\n   &lt;\/dependencies&gt;\n<\/pre>\n<p><figure id=\"attachment_51076\" aria-describedby=\"caption-attachment-51076\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/maven.jpg\"><img decoding=\"async\" class=\"wp-image-51076 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/maven.jpg\" alt=\"\" width=\"860\" height=\"568\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/maven.jpg 860w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/maven-300x198.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/maven-768x507.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-51076\" class=\"wp-caption-text\">Maven Project Creation<\/figcaption><\/figure>[ulp id=&#8217;ODQaBEw1BIbHApZq&#8217;]<\/p>\n<h2>5. Project Structure<\/h2>\n<p>We will be using <code>javacodegeeks.junit<\/code> package. It has an object of page elements as well as the url for node and hub. We will be running test cases from test directory using JUnit.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>GmailLogin.java<\/em><\/span><\/p>\n<pre class=\"brush:java; wrap-lines:false\">package javacodegeeks.Junit;\n\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.WebElement;\nimport org.openqa.selenium.remote.DesiredCapabilities;\n\npublic class GmailLogin {\n\n\tWebDriver driver;\n\tString nodeUrl = \"http:\/\/192.168.1.102:5555\/wd\/hub\";\n\tString hubUrl = \"http:\/\/192.168.1.102:4444\/wd\/hub\";\n\t\n\tSystem.setProperty(\"webdriver.chrome.driver\",\"\/\/Users\/\/saraddhungel\/\/Downloads\/\/chromedriver\");\n\tDesiredCapabilities caps = DesiredCapabilities.chrome();\n\t\n\tpublic GmailLogin(WebDriver driver)\n\t{\n\t\tthis.driver = driver;\n\t}\n\t\n\tBy username = By.xpath(\"\/\/input[@id='Email']\");\n\tBy next = By.xpath(\"\/\/input[@id='next']\");\n\tBy password = By.xpath(\"\/\/input[@id='Passwd-hidden']\");\n\t\n\tpublic WebElement username()\n\t{\n\t\treturn driver.findElement(username);\n\t}\n\t\n\tpublic WebElement next()\n\t{\n\t\treturn driver.findElement(next);\n\t}\n\t\n\tpublic WebElement password()\n\t{\n\t\treturn driver.findElement(password);\n\t}\t\n\t\n}\n<\/pre>\n<p>This class contains the parameterized constructor <code>GmailLogin<\/code> which takes a <code>WebDriver<\/code> as parameter to invoke the url of node and hub. The Web Elements of the page are stored as method of the classes. We will create an object of the <code>GmailLogin<\/code> class to access those methods for username and password. <code>DesiredCapabilities<\/code> class provides a method that determines the browser and the OS that can be used. In order to access an instance of the browser, we need to create an object of the <code>DesiredCapabilities<\/code> class.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>LogintoGmail.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package javacodegeeks.Junit;\n\nimport java.util.concurrent.TimeUnit;\n\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.chrome.*;\n\nimport javacodegeeks.Junit.GmailLogin;\n\npublic class LogintoGmail {\n\n@Test\n  public void hubLogin() \n\t  {\n\t\t  WebDriver driver = new RemoteWebDriver(new url(\"http:\/\/192.168.1.102:4444\/wd\/hub\"), caps );\n\t\t  driver.get(\"https:\/\/accounts.google.com\/ServiceLogin?continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&amp;service=mail&amp;sacu=1&amp;rip=1#identifier\");\n\t\t  driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t  \n\t\t  GmailLogin gl = new GmailLogin(driver);\n\t\t  gl.username().sendKeys(\"test123@gmail.com\");\n\t\t  gl.next().click();\n\t\t  gl.password().sendKeys(\"test123!\");\t \n\t\t  driver.close();\n\t  }\n@Test\n  public void nodeLogin() \n  {\n\t  WebDriver driver = new RemoteWebDriver(new url(\"http:\/\/192.168.1.102:5555\/wd\/hub\"), caps );\n\t  driver.get(\"https:\/\/accounts.google.com\/ServiceLogin?continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&amp;service=mail&amp;sacu=1&amp;rip=1#identifier\");\n\t  driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t  \n\t  GmailLogin gl = new GmailLogin(driver);\n\t  gl.username().sendKeys(\"testing123@gmail.com\");\n\t  gl.next().click();\n\t  gl.password().sendKeys(\"test123!\");\t\n          driver.close(); \n\t \n  }\n driver.close();\n}\n<\/pre>\n<p>There are two test cases in this class. The <code>hubLogin()<\/code> and the <code>nodeLogin()<\/code> contain the Node and the Hub URL where the <code>WebDriver<\/code> interface will invoke the gmail url. The <code>username()<\/code> method from <code>GmailLogin<\/code> class is used to send the username to the page and also all the methods, such as <code>username()<\/code>, <code>next()<\/code> and <code>password()<\/code> from <code>GmailLogin<\/code> class, are implemented. Once the actions are completed the <code>driver.close()<\/code> method will close the browser.<\/p>\n<p><figure id=\"attachment_51079\" aria-describedby=\"caption-attachment-51079\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/JUnit.jpeg\"><img decoding=\"async\" class=\"wp-image-51079 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/JUnit.jpeg\" alt=\"\" width=\"800\" height=\"501\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/JUnit.jpeg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/JUnit-300x188.jpeg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/JUnit-768x481.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-51079\" class=\"wp-caption-text\">JUnit<\/figcaption><\/figure><\/p>\n<h2>6. Conclusion<\/h2>\n<p>This example was an attempt to display how we can use the Selenium Grid to run test cases across different browsers as well as different environments. Not only we can implement thread methods to run the parallel test across different browsers at the same time but we can support up to five different nodes. By creating an object of the <code>DesiredCapabilities<\/code> class, we can access different types of OS and browsers where we can run our test access simultaneously.<\/p>\n<h2>7. Download the Eclipse Project<\/h2>\n<p>That was an example of JUnit Selenium Grid.<\/p>\n<div class=\"download\"><strong> Download<\/strong><br \/>\nYou can download the full source code of this example here: <strong><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Junit.zip\"> Selenium Grid JUnit<\/a><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it&#8217;s significance. We will create a Page Object and then we will access that page object from test cases using JUnit. The example will cover the gmail login where we will be invoking the url in node and &hellip;<\/p>\n","protected":false},"author":105,"featured_media":6678,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[1032,913,1677],"class_list":["post-51020","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-junit","tag-junit","tag-selenium","tag-selenium-grid"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JUnit Selenium Grid Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it&#039;s significance. We will create a Page Object\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JUnit Selenium Grid Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it&#039;s significance. We will create a Page Object\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-11T08:00:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-03-20T11:44:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sarad Dhungel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sarad Dhungel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/\"},\"author\":{\"name\":\"Sarad Dhungel\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/aa8435bcc74a94f55f085037a0832ba3\"},\"headline\":\"JUnit Selenium Grid Example\",\"datePublished\":\"2017-10-11T08:00:14+00:00\",\"dateModified\":\"2019-03-20T11:44:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/\"},\"wordCount\":864,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"keywords\":[\"junit\",\"selenium\",\"selenium grid\"],\"articleSection\":[\"junit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/\",\"name\":\"JUnit Selenium Grid Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"datePublished\":\"2017-10-11T08:00:14+00:00\",\"dateModified\":\"2019-03-20T11:44:33+00:00\",\"description\":\"1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it's significance. We will create a Page Object\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"junit\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/junit\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"JUnit Selenium Grid Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/aa8435bcc74a94f55f085037a0832ba3\",\"name\":\"Sarad Dhungel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/10\/Sarad-Dhungel-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/10\/Sarad-Dhungel-96x96.jpg\",\"caption\":\"Sarad Dhungel\"},\"description\":\"I am a graduate in Computer Engineering from Howard University. Third place award winner in Intel-Cornell Cup. Passionate about new emerging software and technology. During free time, I enjoy reading about politics, business, spirituality, technology and traveling.\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/sarad-dhungel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JUnit Selenium Grid Example - Java Code Geeks","description":"1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it's significance. We will create a Page Object","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/","og_locale":"en_US","og_type":"article","og_title":"JUnit Selenium Grid Example - Java Code Geeks","og_description":"1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it's significance. We will create a Page Object","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2017-10-11T08:00:14+00:00","article_modified_time":"2019-03-20T11:44:33+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","type":"image\/jpeg"}],"author":"Sarad Dhungel","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Sarad Dhungel","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/"},"author":{"name":"Sarad Dhungel","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/aa8435bcc74a94f55f085037a0832ba3"},"headline":"JUnit Selenium Grid Example","datePublished":"2017-10-11T08:00:14+00:00","dateModified":"2019-03-20T11:44:33+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/"},"wordCount":864,"commentCount":1,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","keywords":["junit","selenium","selenium grid"],"articleSection":["junit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/","name":"JUnit Selenium Grid Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","datePublished":"2017-10-11T08:00:14+00:00","dateModified":"2019-03-20T11:44:33+00:00","description":"1. Introduction In this example, we will explore the functionality of Selenium Grid and we will understand it's significance. We will create a Page Object","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/junit-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/junit\/selenium-grid-junit-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"},{"@type":"ListItem","position":4,"name":"junit","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/junit\/"},{"@type":"ListItem","position":5,"name":"JUnit Selenium Grid Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/aa8435bcc74a94f55f085037a0832ba3","name":"Sarad Dhungel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/10\/Sarad-Dhungel-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/10\/Sarad-Dhungel-96x96.jpg","caption":"Sarad Dhungel"},"description":"I am a graduate in Computer Engineering from Howard University. Third place award winner in Intel-Cornell Cup. Passionate about new emerging software and technology. During free time, I enjoy reading about politics, business, spirituality, technology and traveling.","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/sarad-dhungel\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/51020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/105"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=51020"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/51020\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/6678"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=51020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=51020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=51020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}