March 13, 2018
Webdriver | Launch Firefox Browser Using Testmate | Proxy
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /home/pkq2w3icktox/public_html/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /home/pkq2w3icktox/public_html/wp-content/plugins/wp-syntax/wp-syntax.php on line 383
The below code launch the Firefox browser using Testmate navigates the URL and performs some search operations. Webdriver needs a gecko driver to launch firefox.
Setup:
Make sureĀ Geckodriver.exe file path is present in the Path system variable.
Firefox Default
InitializeFireFoxDriver method takes the path of gecko driver as a parameter
1 2 3 4 5 | 'Initialize Firefox driver Call wd.InitializeFireFoxDriver("C:\Users\Desktop\selenium") 'Navigate the URL wd.NavigateToUrl("https://www.facebook.com/") |
Firefox Proxy
InitializeFireFoxDriver method takes the path of the gecko driver as a parameter.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 'Initialize Firefox driver wd.InitializeFireFoxOptions() 'initialize proxy wd.InitializeProxy() 'Set HTTP proxy parameters wd.SetHTTP_Proxy("localhost:8800") 'Set Proxy in firefox options wd.SetProxy_FireFoxOptions() 'Initialize Firefox driver Call wd.InitializeFireFoxDriver("C:\Users\Desktop\selenium") |