What is WebDriver? Flashcards
What is a WebDriver?
It is an interface
Why cant we do the following?
WebDriver driver = new WebDriver();
Cannot instantiate an interface
Why we wont prefer FirefoxDriver driver = new FirefoxDriver()
The FirefoxDriver instance which gets created based on above statement will be only able to invoke and act on the methods implemented by FirefoxDriver and supported by Firefox Browser only. We know that FirefoxDriver is a class and it implements all the methods of WebDriver interface. Using this statement, we can run our scripts only on Firefox Browser.
So, once you initiate a Firefox browser using FirefoxDriver driver = new FirefoxDriver(); same object cannot be used to initiate Chrome Browser (you have to rename it)
What is webdriver used for?
WebDriver is an interface used to launch different browsers such as Firefox, Chrome, Internet Explorer, Safari etc.,
What is webelement?
Web element is an interface used to identify the elements in a web page.
what is find by?
FindBy is an annotation used in Page Object Model design pattern to identify the elements.
Selenium WebDriver
allows controlling web browsers as a user would, but programmatically
What is groupID?
Organization, company, person, etc., that created the project.
What is artifactID
Unique name that identifies the project.
What is version?
Particular release of the project. By default, I recommend you use the latest version of every release.
where does Application source code (i.e., Java files) go
src/main/java
Where does Application resources files (i.e., properties, configuration files, etc.) go?
src/main/resources
Which method do you use to load a web page in the current browser.
get(String ulr)
driver.get(“google.com”);
How to get current URL loaded in the browser?
getCurrentUrl()
How to get the title <Tilte> of HTML tag?</Tilte>
getTitle()