Question 1
Question
The following codes will print the page title?
System.out.println(driver.getTitle());
System.out.println(driver.findElement(By.tagName(“title”)).getText());
Question 2
Question
In WebDriver, which method closes the open browser?
Answer
-
close()
-
quit()
-
terminate()
-
shutdown()
Question 3
Question
In WebDriver, which of the following is a valid select statement that selects a value from a drop down element?
Answer
-
selectByIndex()
-
selectByValue()
-
selectByVisibleText()
-
All of the above
-
None of the above
Question 4
Question
Consider the following code snippet
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.presenceOfElementLocated(by));
This is an example of...
Answer
-
Explicit Wait
-
Implicit Wait
-
Fluent Wait
Question 5
Question
Which WebDriver method is used to change focus to an alert, a frame or a browser window?
Answer
-
switchTo()
-
changeTo()
-
setFocus()
-
changeFocus()
Question 6
Question
In WebDriver, which command takes you forward by one page on the browser’s history?
Answer
-
navigate().forward()
-
navigate.forward()
-
Navigate.forward()
-
navigate_forward()
Question 7
Question
In WebDriver, which command can be used to enter values onto text boxes? Select the best answer
Answer
-
sendKeys("text")
-
selenium.type()
-
driver.type("text")
-
sendKeys()
Question 8
Question
In WebDriver, which of the following commands retrieves the text of a html element?
Answer
-
getText()
-
selectText()
-
getElementText()
-
getText(WebElement)
Question 9
Question
In WebDriver, which method navigates to an URL?
Answer
-
get("url")
-
goToUrl("url")
-
navigate.to("url")
-
getUrl("url")
Question 10
Question
Using USAA framework which class extends to test classes?
Answer
-
WebBaseTest
-
WebBasePage
-
BasePage
-
USAABaseTest
Question 11
Question
Using USAA framework what class extends to page classes?
Answer
-
WebBasePage
-
WebBaseTest
-
USAABasePage
-
BasePage
Question 12
Question
which of the following annotations are used by JUnit ?
Answer
-
@After, @Before, @AfterClass, @Test, @BeforeClass
-
@AfterTest, @AfterMethod, @BeforeMethod, @Test, @BeforeTest
-
@Test, @Before, @After
-
None of the above
-
All of the above
Question 13
Question
what element will be selected using the next Xpath expression?
"//a[name='element1']/div/span/p"
Answer
-
a paragraph
-
a link
-
an image
-
none of above
Question 14
Question
According to POM, what does a page class contain?
Answer
-
Actions
-
Services
-
Page Elements
-
All of the above
-
None of the above
Question 15
Question
In log4j, which of the following methods is valid to generate a log?
Answer
-
info()
-
fatal()
-
warn()
-
All of the above
-
None of the above
Question 16
Answer
-
Access controls within the desktop
-
Only test web applications
-
Both web and desktop applications
Question 17
Question
What element will be selected with the following statement?
driver.findElement(By.cssSelector("#name"));
<div>
<span id=”name”>Name 1</span>
<span class="name">Name 2</span>
</div>
Question 18
Question
How to create an instance of WebDriver in Java?
Answer
-
WebDriver driver = FirefoxDriver();
-
WebDriver = new FirefoxDriver();
-
WebDriver driver = CreateObject FirefoxDriver();
-
WebDriver driver = new FirefoxDriver();
Question 19
Question
in JUnit, @Before annotation will execute the method for every @Test methods in the test class?
Question 20
Question
Assertions can be defined in Page classes?
Question 21
Question
Select an option which is NOT a type of locators.
Answer
-
id
-
className
-
xpath
-
cssSelector
-
style
Question 22
Question
Which of the following options is declaring an implicit wait?
Answer
-
webDriver.manage().timeouts.implicitlyWait(10, TimeUnit.SECONDS)
-
WebDriverWait wait = new ImplicitWaitTime();
wait.implicitWait(10, TimeUnit.SECONDS);
-
webDriver.implicitWaitTime().setExplicitTime(driver, 10);
-
ImpicitWait = webDriver.timeOuts().setExplicitWait(10, TimeUnit.SECONDS )
Question 23
Question
Extending from WebBasePage to page class, you need to implement...
(select all the applicable)
Question 24
Question
What element can be manipulate using "Select" class?
Answer
-
Dropdown lists
-
Check boxes
-
Radio button
-
Buttons
-
Text box areas
Question 25
Question
Which element will be selected with the following instructions?
Select option = new Select(driver.findElementBy.name("list"));
option.deselectByVisibleText("Saab");
<select name="list">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
</select>
Answer
-
Volvo
-
Saab
-
Mercedes
-
All of the above
-
None of the above