Selenium Quiz 1. In Selenium WebDriver, which methods you use to navigate to https://staging-softwaretestingmaterialcom.kinsta.cloudi. navigate().to("url")ii. open("url")iii. goTo("url"iv. get("url") i & ii ii & iii i & iv ii & iv 2. Which of the following WebDriver class is used to run Selenium tests in Google Chrome? ChromeDriver RemoteWebDriver HtmlUnitDriver InternetExplorerDriver 3. Choose the correct option to access an element by id driver.findElement(By.xpath("//*[@id='value']")) driver.findElement(By.xpath("\\*[id='value']")) driver.findElement(By.xpath("//*[#id='value']")) None 4. The Selenium can access elements outside of the web application under test only test web applications test both web and desktop applications add elements to the inbuilt object repository 5. Select the correct option on how to select an element that contains “SoftwareTestingMaterial” WebElement element = driver.findElement(By.xpath("//*[contains(text(), ' SoftwareTestingMaterial')]")); WebElement element = driver.findElement(By.xpath("\\*[contains(text(), ' SoftwareTestingMaterial')]")); WebElement element = driver.findElement(By.xpath("//*[text(' SoftwareTestingMaterial')]")); None 6. What is the JavaScript method used to scroll to a particular Element? ((JavascriptExecutor) driver).executeScript(“arguments[0].scrollIntoView(true);”, element); ((JavascriptExecutor) driver).executeScript(“arguments.scrollIntoView(true);”, element); ((JavascriptExecutor) driver).executeScript(“arguments[0].scrollTo(true);”, element); ((JavascriptExecutor) driver).executeScript( element); 7. What is default wait time for implicit wait in Selenium WebDriver? 0 sec 15 sec 30 sec None of the above 8. Which command you use to retrieve the text using Selenium WebDriver? getText() getElementText() getText(WebElement) None of the above 9. What is the difference between WebDriver and RemoteWebDriver? WebDriver is a class and RemoteWebDriver is an interface WebDriver is an interface and RemoteWebDriver is a class WebDriver and RemoteWebDriver is a class WebDriver and RemoteWebDriver is an interface 10. Select the Wait below which is not provided by Selenium WebDriver? Implicit Wait Explicit Wait Fluent Wait Sleep 11. In Selenium WebDriver, which method closes all the open browsers? quit() close() terminate() 12. Is Selenium Web a component of the Selenium? No Yes 13. Select the Operating system which is supported by Selenium WebDriveri. Windowsii. Mac OSiii. Linux i, ii ii, iii i, iii i, ii, iii 14. In Selenium WebDriver, which method takes you a single item forward in the browser’s history? navigate().back() navigate().forward() None of the above 15. Select the command which is used to check the presence of a web element? verifyElementPresent verifyTextPresent isElementPresent isElementExist 16. Which is not the type of the locators ID Link Text Type Text Name 17. Selenium WebDriver is used To automate the testing of a mobile devices Runs tests only on firefox browser Runs tests only on chrome browser To automate the testing of a web application 18. Which command you use to enter values in a text box? sendKeys() sendKeys() sendKey("text") sendsKeys () 19. What are the types of exceptions thrown in web driver? ElementNotVisibleException StaleElementReferenceException ElementNotSelectableException All of the above 20. Which statement is correct “/” is used to create an absolute XPath and “//” is used to create relative XPath “/” is used to create relative XPath and “//” is used to create an absolute XPath Both “/” and “//” are used to create absolute XPath Both “/” and “//” are used to create relative XPath 21. Choose the correct option which performs a context-click at the current mouse location. context-Click() context.click() context.Click() contextClick() 22. Select the language which is supported by Selenium WebDriveri. Cobolii. Perliii. Javaiv. SQL i, ii ii, iii iii, iv ii, iv 23. In Selenium WebDriver, which of the following is not a valid select statement? i. selectByValues()ii. selectByIndex()iii. selectByVisibleText() i, ii, iii i, ii ii, iii i, iii 24. Is Explicit wait applied only to a single element for a specified amount of time True False 25. Select the below navigation methods of WebDriver? forward() back() refresh() click() 26. What is the recommended way to handle dynamic elements?i. By using relative XPath locatorsii. By using regular expressions i, ii i ii None 27. Choose the correct option which selects the option at the given index selectIndexes() selectByIndex() selectByIndexes() selectIndex() 28. In Selenium WebDriver, which method closes the open browser? quit() close() terminate() 29. Selenium IDE supports which browser? Google Chrome Mozilla Firefox Internet Explorer Safari All of the above 30. Which of the following WebDriver is used for Headless browser testing? HeadLessDriver HtmlUnitWebDriver FireFoxDriver ChromeDriver 31. Is Implicit wait time applied to all elements in your code? True False 32. Which is the Supermost interface in Selenium WebDriver? WebDriver SearchContext WebElement JavascriptExecutor 33. How to click on an element at certain coordinates using Selenium By passing the x, y coordinates in the click() command By using Actions class – moveToElement(element, xOffset, yOffset) 34. Which command you use to navigate to https://staging-softwaretestingmaterialcom.kinsta.cloud driver.navigate(“https://staging-softwaretestingmaterialcom.kinsta.cloud”) driver.navigate().to(“https://staging-softwaretestingmaterialcom.kinsta.cloud”) driver.navigate().Url(“https://staging-softwaretestingmaterialcom.kinsta.cloud”) 35. Running driver.get(“staging-softwaretestingmaterialcom.kinsta.cloud”) will: Navigates to a page staging-softwaretestingmaterialcom.kinsta.cloud No protocol is specified, so an exception will be thrown Navigates to a page https://staging-softwaretestingmaterialcom.kinsta.cloud Time is Up! Time's up