Syntax to declare driver in Selenium is
Webdriver driver = new.firefoxdriver()
Is there any other way to declare driver. The syntax will open the firefox browser. I am trying to declare driver without opening browser.
Syntax to declare driver in Selenium is
Webdriver driver = new.firefoxdriver()
Is there any other way to declare driver. The syntax will open the firefox browser. I am trying to declare driver without opening browser.
You can declare like this
wd=webdriver.Firefox()
but this will also launch the browser as selenium is designed to work in a web browser, but if you want to test something without launching the browser you can use HTMLUnitDriver, which is a headless browser and used to run test cases without actually launching the browser.