Running Your Automation in Browser Nodes without Selenium Grid

Running Your Automation in Browser Nodes without Selenium Grid

In the previous article I showed you how we can execute scripts in Selenium Grid in Docker. I was thinking how we can run Selenium automation scripts without the Grid, where we can execute the scripts in different browser nodes.

This can be done in the following way.

First pull the Docker container which is selenium/standalone-chrome-debug

docker pull selenium/node-chrome-debug

Next start the selenium/standalone-chrome-debug container

docker run –d –P –link selenium-hub:hub selenium/node-chrome-debug

Do a docker ps command and check the port of the container and login via VNC Viewer.

No alt text provided for this image

Connect via VNC with port number 32769 in this case.

No alt text provided for this image

Now modify the script with the IP address of the Remote Web Driver and execute the script.

	@Test
		
		public void test() throws EngineException, AudioException, EngineStateError, IllegalArgumentException, InterruptedException, IOException
		{
		
			 
			 
			DesiredCapabilities cap = DesiredCapabilities.chrome();
			cap.setPlatform(Platform.LINUX);
			WebDriver driver = new RemoteWebDriver(new URL ("https://127.0.0.1:32770/wd/hub"),cap);
	
		
	    	
	        String baseUrl = "https://demo.guru99.com/V4/";
	      


	        driver.get(baseUrl);
	        
	        driver.findElement(By.name("uid")).sendKeys("mngr206361");
	        driver.findElement(By.name("password")).sendKeys("AdUbupU");
	   
	        driver.findElement(By.name("btnLogin")).click();


	       // System.out.println (driver.findElement(By.xpath("https://tr[@class='heading3']/td")).getText());
	      Assert.assertEquals(driver.findElement(By.xpath("https://tr[@class='heading3']/td")).getText(), "Manger Id : mngr206361");
	        driver.close();
		}

In the VNC Viewer you will see the script getting executed.


Sasidhar Vundela

Lead QA Engineer+ Scrum Master | SDET || EX TCS || EX Infosion || Banking | Retail & Logistics |

2 å¹´

docker run –d –P –link selenium-hub:hub selenium/node-chrome-debug this command is throwing docker: invalid reference format.

赞
回复

要查看或添加评论,请登录

Kushan Shalindra Amarasiri的更多文章

  • Test automation planning and contents of a test automation plan.

    Test automation planning and contents of a test automation plan.

    Test automation is an important in any software development project. It facilitates faster regression cycles, reduces…

    2 条评论
  • Considerations that should be done when starting test automation in your project or organization

    Considerations that should be done when starting test automation in your project or organization

    Today test automation is a vital part in the software testing practice. Test automation is used to expedite testing and…

  • Use of AI to shape up testing

    Use of AI to shape up testing

    Artificial Intelligence is a popular subject or topic in the IT world which shape up how we live and how we behave…

    2 条评论
  • Let's Start Test Automation with Playwright

    Let's Start Test Automation with Playwright

    Playwright is an open-source framework developed by Microsoft and released in 2020. It is relatively new to the market…

  • Things to consider when developing Test Automation Frameworks

    Things to consider when developing Test Automation Frameworks

    Test automation is a key component in the software development and testing projects. Test automation should be carried…

    6 条评论
  • Most Common Mistakes We Make In Test Automation

    Most Common Mistakes We Make In Test Automation

    Test automation makes are life easy as for a tester as well as for the entire project team. Test automation helps to…

    1 条评论
  • 100% Test Automation is it a Myth or Reality

    100% Test Automation is it a Myth or Reality

    Test automation is now an essential part of the software development project as it has proven benefits to the project…

  • Shift Left Testing and How Test Automation Helps

    Shift Left Testing and How Test Automation Helps

    Today most organizations still practice shift right testing, where we test the software requirements once its delivered…

    2 条评论
  • We talk big on Test Automation but why we fail?

    We talk big on Test Automation but why we fail?

    Test automation has been a crucial part on ensuring the quality of software delivery. Today there are large amount of…

    1 条评论
  • Mistakes by Management in Test Automation

    Mistakes by Management in Test Automation

    Test automation is an essential activity in software testing currently. There are many test automation tools used for…

    2 条评论

社区洞察

其他会员也浏览了