wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Selenium WebDriver

Total questions: 12

Worksheet time: 7mins

Name
Class
Date
1.

What is the method used to launch a browser in Selenium WebDriver?

a)

open()

b)

launch()

c)

get()

d)

start()

2.

Which class is used to represent a dropdown menu in Selenium WebDriver?

a)

Select

b)

Dropdown

c)

Options

d)

Selector

3.

What command is used to click on an element in Selenium WebDriver?

a)

click()

b)

press()

c)

execute()

d)

select()

4.

Which method is used to locate elements by their CSS selectors in Selenium WebDriver?

a)

findElement(By.id())

b)

findElement(By.className())

c)

findElement(By.cssSelector())

d)

findElement(By.tagName())

5.

How can you simulate keyboard events in Selenium WebDriver?

a)

sendKeys()

b)

type()

c)

pressKeys()

d)

inputKeys()

6.

What is the method used to maximize the browser window in Selenium WebDriver?

a)

maximize()

b)

fullscreen()

c)

expand()

d)

resize()

7.

What annotation is used to identify a test method in TestNG?

a)

@TestMethod

b)

@Testcase

c)

@TestFunction

d)

@Test

8.

What command is used to clear the text from an input field in Selenium WebDriver?

a)

clear()

b)

delete()

c)

remove()

d)

erase()

9.

What method is used to switch to a frame in Selenium WebDriver?

a)

switchToFrame()

b)

selectFrame()

c)

frameTo()

d)

switchTo().frame()

10.

What WebDriver method is used to close the current browser window?

a)

close()

b)

quit()

c)

exit()

d)

end()

11.

What is the method used to retrieve the text of an element in Selenium WebDriver?

a)

getText()

b)

text()

c)

readText()

d)

retrieveText()

12.

Which WebDriver method is used to find multiple elements matching the given criteria?

a)

locateElements()

b)

findElements()

c)

getElements()

d)

matchElements()