Forcing Selenium to go to specific Load Balancing node of the application server

As we all may be well aware each server with large traffic may different nodes and it’s highly rare to a single server node for big web application.So when we do Automation Smoke or Regression test, it’s important that we check each and verify our testcases run properly on different nodes.

so here is trick which followed to go to a specific node

  • First it deletes all the codes
  • On the second line, it goes to the  internal ip or the server of the specific node
  • On the third line, it goes to the domain where we hit the node we specified on the 2nd line

 

Browser.Manage().Cookies.DeleteAllCookies();
string internalipurl = "http://node1internalapp";
string applicationurl="http://testapplication.com";
Browser.Navigate().GoToUrl(internalipurl);              
Browser.Navigate().GoToUrl(applicationurl);

 

You may also like...