selenium-kba

Beschreibung

KBA purpose
krishna kumar r
Quiz von krishna kumar r, aktualisiert more than 1 year ago
krishna kumar r
Erstellt von krishna kumar r vor fast 7 Jahre
6344
0

Zusammenfassung der Ressource

Frage 1

Frage
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()
Antworten
  • a. I and II
  • b. II
  • c. I
  • d. Neither I nor II

Frage 2

Frage
To run on Firefox browser, you must have which of the following?
Antworten
  • 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

Frage 3

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

Frage 4

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

Frage 5

Frage
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.”
Antworten
  • a. Verify Text
  • b. VerifyTextPresent
  • c. VerifyElementPresent
  • d. All the Listed option

Frage 6

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

Frage 7

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

Frage 8

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

Frage 9

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

Frage 10

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

Frage 11

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

Frage 12

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

Frage 13

Frage
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:
Antworten
  • a. I and II
  • b. IV
  • c. III
  • d. I,II,III and IV

Frage 14

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

Frage 15

Frage
Identify the correct statements about “Desired Capabilities” from the following. Select one or more
Antworten
  • 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

Frage 16

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

Frage 17

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

Frage 18

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

Frage 19

Frage
How to retrieve Text from Alert pop up window?
Antworten
  • 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);

Frage 20

Frage
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
Antworten
  • 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]

Frage 21

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

Frage 22

Frage
22. Identify the correct code snippet to execute java script through Selenium webdriver
Antworten
  • 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”);

Frage 23

Frage
Identify the incorrect statement about “Implicit wait” from the following options:
Antworten
  • 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

Frage 24

Frage
Which of the following is the correct WebDriver statement to retrieve the row count of a table?
Antworten
  • 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();

Frage 25

Frage
25. Identify the correct code about the following code snippet: MyClass c1,c2,c3; C1 = new MyClass(); C3 = new MyClass(); Select One:
Antworten
  • 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

Frage 26

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

Frage 27

Frage
Identify the correct code snippet to double click an element using selenium, from the following:
Antworten
  • 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();

Frage 28

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

Frage 29

Frage
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
Antworten
  • a. I
  • b. I and II
  • c. II
  • d. Neither I nor II

Frage 30

Frage
Identify the steps to instantiate the chrome driver in correct sequence:
Antworten
  • 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

Frage 31

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

Frage 32

Frage
32. Which of the following is correct command to enter a value in a textbox?
Antworten
  • 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!”);

Frage 33

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

Frage 34

Frage
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
Antworten
  • 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

Frage 35

Frage
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?
Antworten
  • a. alert.accept();
  • b. alert.close();
  • c. alert.Submit();
  • d. alert.click(1);

Frage 36

Frage
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?
Antworten
  • a. ARROW_DOWN and ENTER with sendkeys
  • b. CONTEXT_CLICK method in sendkeys
  • c. RIGHT_CLICK with sendkeys
  • d. SELECT_ITEM(n) in sendkeys

Frage 37

Frage
Which building a JAR, what is/are the role(s) of a manifest file? Select One Or More
Antworten
  • 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

Frage 38

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

Frage 39

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

Frage 40

Frage
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?
Antworten
  • a. @BeforeTest
  • b. @Test
  • c. @BeforeSuite
  • d. @Parameters

Frage 41

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

Frage 42

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

Frage 43

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

Frage 44

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

Frage 45

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

Frage 46

Frage
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?
Antworten
  • a. Selenium RC
  • b. Selenium Grid
  • c. SeleniumIDE
  • d. WebDriver

Frage 47

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

Frage 48

Frage
Which statement used to verify element is present rather than verifying its content
Antworten
  • a. ElementToBePresent
  • b. TextToBePresent
  • c. VerifyText
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

10 Lernmethoden
AntonS
Der menschliche Körper
anna.grillborzer0656
Post-colonialism and migration
steffen_1411
Abiturthemen 2016 in Deutsch für alle Bundesländer
Laura Overhoff
Wagenkunde
malimi something
40.1 Bildungswissenschaft
Yvonne Heitland
Vetie Immunologie
Anne Heyne
Vetie Radiologie VL-Fragen
Carolina Heide
Vetie Radiologie VL-Fragen
Carolina Heide
Repro 2016 Vetie
Julia To