CSE

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?

  1. It will fail in identifying the “FORGOT” button.
  2. It will fail to click the “FORGOT” button.
  3. It will work as expected.
  4. A compilation error.

Question 7

Given the following HTML snippet, which of the following XPath selectors is a valid locator for userName Text Field?

  1. (//input)[2]
  2. input[type=‘text’]
  3. (//input)[0]
  4. (//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”?

  1. Select cars = new Select(elem);cars.findElement(by).selectByVisbileText(‘Audi’);
  2. Select cars = new Select(elem);cars.selectByVisbileText(‘Audi’);
  3. elem.sendKeys(“Audi”);
  4. elem.click();driver.findElement(by).click();