March 15, 2018
Webdriver | Launch Chrome Browser Using Testmate | Proxy | Arguments
Webdriver needs chromedriver.exe file to launch a chrome browser. The below code launch the chrome browser using Testmate. It demonstrates various available options like add arguments and set proxy. For more information on the available constructors, simply mouse-over on the method name in the tool.
InitializeChromeDriver method takes the path of chromedriver.exe as a parameter.
1 2 3 4 5 6 7 8 9 10 | 'Initialize the Chrome driver Call wd.InitializeChromeDriver("C:\Users\jaska\Desktop\selenium") 'Maximize the window wd.MaximizeWindow() 'Navigate to the URL and search wd.NavigateToUrl("https://www.google.com/") Call wd.SendKeys("name::q","Hello World") Call wd.Click("name::btnK") |
Add Arguments
1 2 3 4 | 'Initialize the Chrome driver Call wd.InitializeChromeOptions() Call wd.AddArgument_ChromeOptions("disable-infobars") Call wd.InitializeChromeDriver("C:\Users\jaska\Desktop\selenium") |
Proxy & Arguments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 'Reinitialize the options wd.InitializeChromeOptions() 'To Reinitialize Proxy - Just in case Host proxy object is already assigned some values(This is Optional) Call wd.InitializeProxy() 'Set HTTP Proxy value in the proxy object Call wd.SetHTTP_Proxy("localhost:8888") 'Set proxy in chrome options Call wd.SetProxy_ChromeOptions() 'Initialize driver Call wd.InitializeChromeDriver("C:\Users\jaska\Desktop\selenium") 'Maximize window wd.MaximizeWindow() 'Navigate to URls wd.NavigateToUrl("https://www.facebook.com/") |