What is syntax to Initialize browser in webdriver?


Posted On: Apr 08, 2020


By following the below-mentioned steps one may initiate browser in web driver

  • Action 1: Download Chrome Drive
  • Action 2: Unlock any browser and access http://www.seleniumhq.org/download/ Here you will get a third multitude driver part and you may get all the surface drivers for diverse browsers.

Your test sample will crash, and you will get IllegalStateException that says one needs to particularize the chrome driver path where it occupies.

import org. openqa. selenium. WebDriver;
import org. openqa. selenium. chrome. ...
public class TestChrome {
public static void main(String[] args) {
System. setProperty("webdriver.chrome.driver", "path of the exe file\\chromedriver.exe");
// Initialize browser.
WebDriver driver=new ChromeDriver();

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Cognizant Testing Interview Questions

    Explain what is STLC?

    STLC stands for Software Testing Life Cycle. STLC happens to be a series of different actions implemented by the examination team to guarantee the condition of the product or the software. As promptly...

    Cognizant Testing Interview Questions

    What is use of driver.getTitle() in selenium?

    driver. getTitle() process will capture the current started page heading and later it will be saved in a variable and next it will be published in the console. Presently you can utilize its usefulness...

    Cognizant Testing Interview Questions

    What is SDLC?

    Software Development Life Cycle (SDLC) is nothing but a process that is utilized by the software manufacturing sectors to develop, design and test high-quality software. The SDLC strives to manufactur...