Posts

Showing posts from 2018

Run geckodriver before launching the browser

  Inorder to launch empty firefox browser,just create a object to browser class,it automatically launches a browser,bcoz constructor has the code to launch empty browser. get() is used to navigate to any web application URL,but URL should start with "http:" or "https:" Note: Webdriver internally uses http or https protocol for browser communication. Example as below: import org.openqa.selenium.firefox.firefoxDriver; public class SampleFirstTest {               System.setProperty("webDriver.gecko.Driver",c://....path u should give");              FirefoxDriver driver=new FirefoxDriver();              driver.get("https://facebook.com");    } Webdriver basic Browser operation:      get()    navigate().to()    navigate().refresh();    navigate().back()    navigate().forward()    findElement()    findElements()    getTitle()    getCurrentUrl()    getPageSource()    getWindowHandles()    quit()    close()    ma