Professional Documents
Culture Documents
Quiz With Answers 5
Quiz With Answers 5
Quiz With Answers 5
a) Java
b) Python
c) C#
d) JavaScript
Answer: a) Java
c) By using the Select class and its methods like selectByVisibleText(), selectByValue(), or selectByIndex()
d) By using the driver.switchTo().frame("frameName"); method
Answer: c) By using the Select class and its methods like selectByVisibleText(), selectByValue(), or
selectByIndex()
b) By using the driver.switchTo().alert() method to switch to the alert and then using methods like
accept(), dismiss(), or getText()
Answer: b) By using the driver.switchTo().alert() method to switch to the alert and then using methods
like accept(), dismiss(), or getText()
What is the correct way to wait for an element to be visible in Selenium WebDriver?
c) By using fluent waits with the Wait interface and its methods like until()
d) By using conditional statements like if and else to check the visibility of the element
Answer: b) By using the Actions class and its methods like contextClick(element).perform();
How can you handle multiple windows or tabs in Selenium WebDriver?
b) By using the driver.getWindowHandles() method to get all window handles and then switching to the
desired window by handle
c) By using the driver.getWindowHandle() method to get the current window handle and then switching
to the desired window
Answer: b) By using the driver.getWindowHandles() method to get all window handles and then
switching to the desired window by handle
How can you perform keyboard actions like pressing Enter or typing text in Selenium WebDriver?
a) By using the Actions class and its methods like sendKeys(Keys.ENTER) or sendKeys("text")
Answer: a) By using the Actions class and its methods like sendKeys(Keys.ENTER) or sendKeys("text")
Answer: b) By using the Actions class and its methods like moveToElement(element).perform();
How can you handle browser windows and tabs in Selenium WebDriver?
How can you simulate keyboard actions like pressing Esc or Ctrl+A in Selenium WebDriver?
b) By using the Actions class and its methods like sendKeys(Keys.ESCAPE) and
sendKeys(Keys.chord(Keys.CONTROL, "a")).perform();
d) Keyboard actions like pressing Esc or Ctrl+A are not supported in Selenium WebDriver
Answer: b) By using the Actions class and its methods like sendKeys(Keys.ESCAPE) and
sendKeys(Keys.chord(Keys.CONTROL, "a")).perform();
Answer: b) By using the Actions class and its methods like sendKeys(Keys.ARROW_DOWN) or
sendKeys(Keys.PAGE_DOWN)