Webdriver | Launch Firefox Browser Using Testmate | Proxy

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")

Add a Comment

Your email address will not be published. Required fields are marked *