Dynamic Pages, Window Alerts, Pop-Ups


  1. Is Selenium able to handle dynamic AJAX elements?
    1. Yes
    2. No
    3. Cant Say
    Ans: 1
  2. How to use xpath for dynamic elements?
    1. Identify the pattern and modify xpath pattern
    2. Directly use the xpath?
    3. Both 1 and 2
    4. None of the above
    Ans: 1
  3. Selenium can handle Javascript alerts.
    1. TRUE
    2. FALSE
    Ans: 1
  4. Is Regular expression helps to identify dynamic elements?
    1. Yes
    2. No
    3. Not very compatible
    Ans: 3
  5. How to check if any check box is checked or not?
    1. driver.findElement(By.id(<>).Selected()
    2. driver.findElement(By.id(<>).isSelected()
    3. driver.findElement(By.id(<>).isChecked()
    4. All of the above
    Ans: 2
  6. Can Selenium handle Alerts or Pop ups windows?
    1. Yes
    2. No
    Ans: 1
  7. What is getWindowHandle method?
    1. Method will help to handle parent window
    2. Method will help to handle of opened windows other than parent
    3. Only handles alert
    4. None of the above
    Ans: 2
  8. How to handle alert using selenium?
    1. driver.switchto.popup()
    2. driver.switchto
    3. driver.switchto.alert()
    4. None of the above
    Ans: 3
  9. What is Iterator?
    1. Iterator enables you to cycle through a collection, obtaining or removing elements
    2. It basically starts at the beginning of a collection
    3. When you want to know which things are in a certain collection, you iterate over the collection, which is just another term for going through all elements. This is what an Iterator does
    4. All of the above
    Ans: 4
  10. After the popup actions, how to switch the driver back to the parent window?
    1. browser.switchTo().window(parentWindowHandle);
    2. browser.switchTo().alert();
    3. Both 1 & 2
    4. None of the above
    Ans: 1

Followers