What is WebDriver? Flashcards

1
Q

What is a WebDriver?

A

It is an interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why cant we do the following?
WebDriver driver = new WebDriver();

A

Cannot instantiate an interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why we wont prefer FirefoxDriver driver = new FirefoxDriver()

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is webdriver used for?

A

WebDriver is an interface used to launch different browsers such as Firefox, Chrome, Internet Explorer, Safari etc.,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is webelement?

A

Web element is an interface used to identify the elements in a web page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is find by?

A

FindBy is an annotation used in Page Object Model design pattern to identify the elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Selenium WebDriver

A

allows controlling web browsers as a user would, but programmatically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is groupID?

A

Organization, company, person, etc., that created the project.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is artifactID

A

Unique name that identifies the project.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is version?

A

Particular release of the project. By default, I recommend you use the latest version of every release.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

where does Application source code (i.e., Java files) go

A

src/main/java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Where does Application resources files (i.e., properties, configuration files, etc.) go?

A

src/main/resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which method do you use to load a web page in the current browser.

A

get(String ulr)

driver.get(“google.com”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to get current URL loaded in the browser?

A

getCurrentUrl()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to get the title <Tilte> of HTML tag?</Tilte>

A

getTitle()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to find the first WebElement using a given locator in the current web page

A

findElement(By by)

17
Q

How to find every WebElement using a given locator in the current web page

A

findElements(By by)

18
Q

How to find the HTML source code of the current webpage

A

getPageSource();

19
Q

How to access the browser history and navigate to a given URL

A

navigate()

20
Q

how to get the window handle, i.e., a unique identifier for the open window in the current browser

A

getWindowHandle()

21
Q

How to get the set of window handles currently open in the current browser

A

getWindowHandles()

22
Q

How to select a frame or window in the current browser

A

switchTo()

23
Q

How to Close the current window, quitting the browser if there are no more windows opened.

A

close()

24
Q

how to Close all windows and quit the browser.

A

quit()

25
Q

List webdriver methods?

A

getTitle()
quit()
close()
switchTo()
getWindowHandle()
getWindowHandles()
navigate()
getPageSource()
getCurrentUrl()
get()

26
Q

List webelement methods

A

click()
submit()
sendKeys()
clear()
getTagName()
getDomProperty()
getDomAttribute()
getAttribute()
getAriaRole()
getAccessibleName()
isSelected()
isEnabled()
isDisplayed()
getText()