CSE practice questions, page 2 of 2, with answer review and explanations.
Question 6
Consider the following HTML snippet:What do you expect the output would be?
It will fail in identifying the “FORGOT” button.
It will fail to click the “FORGOT” button.
It will work as expected.
A compilation error.
Question 7
Given the following HTML snippet, which of the following XPath selectors is a valid locator for userName Text Field?
(//input)[2]
input[type=‘text’]
(//input)[0]
(//input)[1]
Question 8
Given the following HTML snippet for a drop-down list: (Assume driver as WebDriver.)AND the following Java code for this drop-down identification:Which of the following would be the NEXT code instructions to select the drop-down option with text “Audi”?
Select cars = new Select(elem);cars.findElement(by).selectByVisbileText(‘Audi’);
Select cars = new Select(elem);cars.selectByVisbileText(‘Audi’);