selenium-kba

Descripción

KBA purpose
krishna kumar r
Test por krishna kumar r, actualizado hace más de 1 año
krishna kumar r
Creado por krishna kumar r hace casi 7 años
6344
0

Resumen del Recurso

Pregunta 1

Pregunta
Identify the appropriate option to be used to ensure that the Selenium scripts stops if a check fails and doesnot run any subsequent checks. i. Verify() ii. Assert()
Respuesta
  • a. I and II
  • b. II
  • c. I
  • d. Neither I nor II

Pregunta 2

Pregunta
To run on Firefox browser, you must have which of the following?
Respuesta
  • a. FirefoxDriver is installed, similar to IEDriver and ChromeDriver Setup
  • b. Only Firefox browser is installed
  • c. Firefox plug-ins are installed
  • d. Both FirefoxDriver and Firefox browser are installed

Pregunta 3

Pregunta
Which of the following is the correct option to close all the opened browser sessions at one step?
Respuesta
  • a. driver.exit()
  • b. driver.quit()
  • c. driver.closeAll()
  • d. driver.close()

Pregunta 4

Pregunta
Which of the following is the best option for selenium to test an asynchronous webpage?
Respuesta
  • a. Sleep
  • b. Explicit Wait
  • c. Fluent Wait
  • d. Implicit Wait

Pregunta 5

Pregunta
Identify the correct command which “verifies an expected UI element, as defined by its HTML Tag and checks for its presence alone rather than its content.”
Respuesta
  • a. Verify Text
  • b. VerifyTextPresent
  • c. VerifyElementPresent
  • d. All the Listed option

Pregunta 6

Pregunta
6. Which of the Following functionality is NOT supported by Selenium IDE?
Respuesta
  • a. All the Listed options
  • b. Database Testing
  • c. Conditional Statements
  • d. Error Handling

Pregunta 7

Pregunta
Firefox Driver is capable of being run and is tested on which of the following operating Systems?
Respuesta
  • a. Windows and Mac
  • b. Windows only
  • c. Windows and Linux
  • d. Windows, Mac and Linux

Pregunta 8

Pregunta
Identify the Correct XPath for the Submit button
Respuesta
  • a. //div[(contains(@class ‘submit’))]
  • b. //div[contains(@class, ‘submit’)]
  • c. //div[@contains(class, ‘submit’)]
  • d. //div[contains(@class ‘submit’)]

Pregunta 9

Pregunta
In WebDriver, which of the following is valid select statement that selects a value from a drop down element?
Respuesta
  • a. SelectByVisibleText()
  • b. All of the listed options
  • c. SelectByValue()
  • d. SelectByIndex()

Pregunta 10

Pregunta
Identify the correct code snippet to switch between different windows
Respuesta
  • a. driver.switchTo().window(Integer);
  • b. driver.switchTo().window(Array);
  • c. driver.switchTo().window(String);
  • d. driver.switchTo().window(ArrayList);

Pregunta 11

Pregunta
We generally use Listener to generate log events. Identify the correct selenium component that support listeners.
Respuesta
  • a. Selenium WebDriver
  • b. All of the Listed options
  • c. Selenium IDE
  • d. Selenium RC

Pregunta 12

Pregunta
Which of the following is used to toggle a checkbox in a web form? Select One or More:
Respuesta
  • a. Element.set();
  • b. Element.click();
  • c. Element.toggle();
  • d. Element.Select();

Pregunta 13

Pregunta
13. Identify the correct code snippet which cannot refresh the webpage from the following options: i. driver.get(driver.getCurrentURL()); ii. driver.navigate().to(driver.getCurrentURL()); iii. driver.findElement(By.xpath(“//h1[@class=’title’]”)).sendkeys(keys.F5); iv. driver.open(driver. getCurrentURL()); Select One:
Respuesta
  • a. I and II
  • b. IV
  • c. III
  • d. I,II,III and IV

Pregunta 14

Pregunta
Which of the following is the correct “Webdriver” Command to “delete all cookies in the browser”?
Respuesta
  • a. driver.manage().deleteAllCookies();
  • b. driver. deleteCookies();
  • c. driver.deleteAllCookies();
  • d. driver.manage().deleteCookies();

Pregunta 15

Pregunta
Identify the correct statements about “Desired Capabilities” from the following. Select one or more
Respuesta
  • a. To execute multiple test cases on multiple systems with different browsers with different version and different operating System
  • b. Desired Capabilities class is used while working with Selenium Grid
  • c. Desired Capabilities class is used to handle page synchronization
  • d. All of the listed options

Pregunta 16

Pregunta
16. Which command should be used to ensure Selenium applies wait time of all UI elements in the scripts?
Respuesta
  • a. Sleep
  • b. Explicit Wait
  • c. Fluent Wait
  • d. Implicit Wait

Pregunta 17

Pregunta
Which of the following Selenium API enables running Selenium 1.0 test in Web driver?
Respuesta
  • a. Webdriver
  • b. None of the listed options
  • c. WebDriverBackedSelenium
  • d. Selenium RC

Pregunta 18

Pregunta
Identify the appropriate Test Frameworks supported by Selenium Webdriver
Respuesta
  • a. All of the listed options
  • b. NUnit
  • c. Junit
  • d. TestNG

Pregunta 19

Pregunta
How to retrieve Text from Alert pop up window?
Respuesta
  • a. Alert alert = driver.switchalert(); String alerttext = alert.getvalue(text);
  • b. Alert alert = driver.switchTo().alert; String alerttext = alert.getText(text);
  • c. Alert alert = driver.alert; String alerttext = alert.getText(text);
  • d. Alert alert = driver.switchalert; String alerttext = alert.getText(text);

Pregunta 20

Pregunta
20. Identify the correct code snippet to parameterize the Xpath: “//*[@id=xxxxx]/a[2]/span/span[2]”. So that the “xxxxx” can be parameterize and the test can be executed with multiple test data
Respuesta
  • a. //*[@id=”+paraValue+”]/a[2]/span/span[2]
  • b. //*[starts-with(@id=”+paraValue+”)]/a[2]/span/span[2]
  • c. //*[contains(@id=”+paraValue+”)]/a[2]/span/span[2]
  • d. //*[@id=+”””+paraValue+”]”/a[2]/span/span[2]

Pregunta 21

Pregunta
21. Which of the following should be used to distribute tests on multiple machines, so that test can be run parallel to each other?
Respuesta
  • a. Selenium Webdriver
  • b. Selenium RC
  • c. Selenium IDE
  • d. Selenium Grid

Pregunta 22

Pregunta
22. Identify the correct code snippet to execute java script through Selenium webdriver
Respuesta
  • a. JavaScriptExecutor js = (JavaScriptExecutor)driver; String title = (string)js.executeScript(“Pass your Java Script”);
  • b. JavaScriptExecutor js = (JavaScriptExecutor)Webbrowser; String title = (string)js.executeScript(“Pass your Java Script”);
  • c. JavaScriptExecutor js = (JavaScriptExecutor)Webbrowser; String title = (string)js.execute(“Pass your Java Script”);
  • d. JavaScriptExecutor js = (JavaScriptExecutor)driver; String title = (string)js.execute (“Pass your Java Script”);

Pregunta 23

Pregunta
Identify the incorrect statement about “Implicit wait” from the following options:
Respuesta
  • a. An implicit wait is the code you define to wait for a certain condition to occur before proceeding further in the code
  • b. Once set, the implicit wait is the set for the life of the WebDriver object instance
  • c. To instruct WebDriver to poll the DOM for a certain amount of time when trying to find an element.
  • d. The default implicit wait setting is 0

Pregunta 24

Pregunta
Which of the following is the correct WebDriver statement to retrieve the row count of a table?
Respuesta
  • a. driver.findElements(By.xpath(“//table[@id=’tableD’]/tr”)).getrowcount();
  • b. All the Listed options
  • c. driver.findElements(By.xpath(“//table[@id=’tableD’]/tr”)).getcount();
  • d. Driver.findElements(By.xpath(“//table[@id=’tableD’]/tr”)).size();

Pregunta 25

Pregunta
25. Identify the correct code about the following code snippet: MyClass c1,c2,c3; C1 = new MyClass(); C3 = new MyClass(); Select One:
Respuesta
  • a. Only 3 objects are created c1,c2 and c3
  • b. Only 2 objects are created c1 and c3. The reference C2 is initialized
  • c. Only 2 objects are created c1 and c2. The reference C3 is only declared and not initialized
  • d. Only 2 objects are created c1 and c3. The reference C2 is only declared and not initialized

Pregunta 26

Pregunta
If you want to automate workflow that have to go through windows authentication dialog box, which additional libraries would you choose?
Respuesta
  • a. All the Listed options
  • b. AutoIT
  • c. Behat
  • d. Selenium Support libraries

Pregunta 27

Pregunta
Identify the correct code snippet to double click an element using selenium, from the following:
Respuesta
  • a. WebElement el = driver.findElement(by.id(“ElementID”));Actions builder = new Actions(driver); builder.doubleclick(el).build();
  • b. WebElement el = driver.findElement(by.id(“ElementID”));Actions builder = new Actions(driver); builder.doubleclick().build().perform();
  • c. WebElement el = driver.findElement(by.id(“ElementID”));Actions builder = new Actions(driver); builder.doubleclick().build();
  • d. WebElement el = driver.findElement(by.id(“ElementID”));Actions builder = new Actions(driver); builder.doubleclick(el).build().perform();

Pregunta 28

Pregunta
Identify the incorrect URL related to Grid console, from the following
Respuesta
  • a. http://localhost.portno/console/grid
  • b. http://localhost.portno
  • c. http://localhost.portno/ grid
  • d. http://localhost.portno/grid/console

Pregunta 29

Pregunta
Identify the correct statement from the following I. “Wait” is called an object, not a thread II. “Sleep” sends the current thread into “not runnable” state for some time
Respuesta
  • a. I
  • b. I and II
  • c. II
  • d. Neither I nor II

Pregunta 30

Pregunta
Identify the steps to instantiate the chrome driver in correct sequence:
Respuesta
  • a. 1.Using System Property set method get the path of the Chrome Driver2.Set the Capabilities of the Chrome browser3.Open a URL4. Initialize chrome driver object with capabilities object as argument
  • b. 1.Using System Property set method get the path of the Chrome Driver2.Set the Capabilities of the Chrome browser3. Initialize chrome driver object with capabilities object as argument4.Open a URL
  • c. 1. Set the Capabilities of the Chrome browser2. Initialize chrome driver object with capabilities object as argument3. Using System Property set method get the path of the Chrome Driver4.Open a URL
  • d. 1.Using System Property set method get the path of the Chrome Driver2. Initialize chrome driver object with capabilities object as argument 3.Open a URL4. Set the Capabilities of the Chrome browser

Pregunta 31

Pregunta
Identify the command which is used to pause execution until the page is loaded completely
Respuesta
  • a. WaitForWindowToLoad
  • b. waitForPage
  • c. WaitForElementPresent
  • d. waitForPageToLoad

Pregunta 32

Pregunta
32. Which of the following is correct command to enter a value in a textbox?
Respuesta
  • a. None of the listed options
  • b. WebElement element = driver.findElement(By.name(“q”));element.sendkeys(“Cheese!”);
  • c. WebElement element = driver.findElement(By.name(“q”));element.setval(“Cheese!”);
  • d. WebElement element = driver.findElement(By.name(“q”));element.type(“Cheese!”);

Pregunta 33

Pregunta
What is the keyword used in Selenium for dealing with Regular Expressions?
Respuesta
  • a. RegularExp
  • b. RegEx
  • c. @regular
  • d. Regexp

Pregunta 34

Pregunta
Identify the correct statements about the code snippet given below: Wait<WebDriver> wait = new FluentWait<WebDriver>(driver) .withTimeouts(30, SECONDS) .pollingEvery(30, SECONDS) WebElement foo = wait.until(new function<WebDriver,WebElement>() { Public WebElement apply (WebDriver, driver) { Return driver.findElement(By.id(“foo”)); } }); Select One or More
Respuesta
  • a. NosuchElementException is ignored automatically
  • b. Checks for the object once every 5 seconds
  • c. A combination of fluent wait and Implicit wait
  • d. Additional step needed to ignore NosuchElementException

Pregunta 35

Pregunta
You are writing scripts for web application automation using Selenium WebDriver. When you try to close the browser you get a popup saying “Are You Sure? The page is asking you to confirm that you want to leave – data entered will be lost. “The page has two buttons, Leave page and stay on page. Which function from the Alert API needs to be called if leave page needs to be selected?
Respuesta
  • a. alert.accept();
  • b. alert.close();
  • c. alert.Submit();
  • d. alert.click(1);

Pregunta 36

Pregunta
A script requires that you open the home page url, right click on a link, choose a context menu item in New tab. Which method will be useful for this operation?
Respuesta
  • a. ARROW_DOWN and ENTER with sendkeys
  • b. CONTEXT_CLICK method in sendkeys
  • c. RIGHT_CLICK with sendkeys
  • d. SELECT_ITEM(n) in sendkeys

Pregunta 37

Pregunta
Which building a JAR, what is/are the role(s) of a manifest file? Select One Or More
Respuesta
  • a. Setting an application’s entry point
  • b. Sealing packages within a JAR File
  • c. Enhancing security with manifest attributes
  • d. Setting package version information

Pregunta 38

Pregunta
Exception handling is targeted at:
Respuesta
  • a. Compile time error
  • b. logical error
  • c. Run time error
  • d. logging error

Pregunta 39

Pregunta
What is the method to simulate the right click event on an element in the application under test using C#.Net implentation?
Respuesta
  • a. ContextClick method
  • b. KeyPress method
  • c. Rightclick method
  • d. Keydown method

Pregunta 40

Pregunta
An application developed needs to be checked in multiple browsers for compatibility. Which annotation would you use in TestNG to achieve this in parallel, and save time?
Respuesta
  • a. @BeforeTest
  • b. @Test
  • c. @BeforeSuite
  • d. @Parameters

Pregunta 41

Pregunta
Which is the folder in which default test reports are created by TestNG?
Respuesta
  • a. Test-output
  • b. Testoutput
  • c. Testout
  • d. TestNG-Testoutput

Pregunta 42

Pregunta
Which of the following Junit is recommended to declare the implicit wait statement?
Respuesta
  • a. “@Test”
  • b. “@Before”
  • c. All of the listed options
  • d. “@After”

Pregunta 43

Pregunta
Which of the following Junit annotation do we declare the command “driver.quit”
Respuesta
  • a. “@Test”
  • b. “@Before”
  • c. “@try”
  • d. “@After”

Pregunta 44

Pregunta
What happens when the application creates a Java Script alert during test case paly?
Respuesta
  • a. Use assertAlert or assertAlertPresent or VerifyAlert
  • b. Use VerifyAlert
  • c. Use assertAlertPresent
  • d. Use assertAlert

Pregunta 45

Pregunta
What should be used in Selenium to wait for some conditions such as “ElementsToBeClickable”
Respuesta
  • a. Sleep
  • b. Explicit Wait
  • c. Implicit Wait
  • d. Fluent Wait

Pregunta 46

Pregunta
The client environment has multiple operating system implementations and regression testing has to be done on all of them.What tool would you use for this scenario?
Respuesta
  • a. Selenium RC
  • b. Selenium Grid
  • c. SeleniumIDE
  • d. WebDriver

Pregunta 47

Pregunta
Which statement used to make selenium script to wait for page loading?
Respuesta
  • a. Elementstobepresent
  • b. PagetoLoad
  • c. PageExist

Pregunta 48

Pregunta
Which statement used to verify element is present rather than verifying its content
Respuesta
  • a. ElementToBePresent
  • b. TextToBePresent
  • c. VerifyText
Mostrar resumen completo Ocultar resumen completo

Similar

Comentario de una obra de Arquitectura
Felicidad
Retribuciones a Empleados
owem_039
Diferencias entre el latín culto y el latín vulgar
Carlos' Badillo Hdez
Estructura atómica. Modelos y Teorías
Jean Paul Arango
MODELOS PEDAGÓGICOS
wfas197
Estructura de la Constitución Española de 1978
Joaquín García Venegas
EVENTOS EN JAVA
**CR 7**
Teorías Antropológicas
tania veloz
TEST 1 CGT-UGT.
Farita LPGC
GEOGRAFÍA MUNDIAL I...
Ulises Yo
TECNICAS DE VENTAS
Mireya Meza Leal