Home

Selenium automation 1000+ MCQ with answer for NDA

Thursday 9th of March 2023

Sharing is caring

1. What does the assertTitle checks ?
A. Element title
B. Page title
C. Block title
D. Title of element under focus
Answer : B
2. Select the method which clears all selected entries in Web driver Selenium.
A. dselectAll()
B. deselect_All()
C. dselect_All()
D. deselectAll()
Answer : D
3. We use the dot (.) operator followed by either a * or a +. The + tells the regular expression that there will be instances between 0 and n, while the * tells the regular expression that there will be instances between 1 and n.
A. True
B. False
C.
D.
Answer : B
4. Which Component is used to run multiple tests simultaneously in different browsers and platforms?
A. Selenium Grid
B. Selenium IDE
C. Selenium RC
D. Selenium Webdriver
Answer : A
5. Which Navigate command takes you forward by one page on the browser's history in Web driver Selenium.
A. navigate.forward()
B. navigate().forward()
C. navigate()_forward()
D. navigate_forword()
Answer : B
6. Which Selenium component supports All Operating System?
A. Selenium Generator
B. Selenium IDE
C. Selenium WebDriver
D.
Answer : C
7. Selects all the parent, grandparent, and so on of the element is related to which axis name in Selenium:
A. Ancestor
B. Preceding
C. Parent
D. All of these.
Answer : A
8. Select the tab which gives feedback and other useful information when executing tests.
A. Information
B. Feedback
C. Reference
D. Element
Answer : C
9. Which component of Selenium can create customized test results.
A. Web driver
B. Selenium RC
C. Selenium IDE
D. Selenium Grid
Answer : A
10. In case of Selenium IDE, the Source view shows your script in
A. DHTML format
B. J2EE format
C. XML format
D. HTML format.
Answer : C
11. What does the term CSS refers to ?
A. Cascade Style Sheets
B. Cascading Style Sheets
C. Clear Style Sheets
D. Catering Style Sheets
Answer : B
12. If you wanted to access the element that has the text This element has an ID that changes every time the page is loaded in it, then which of the following is used:
A. //div[contains(@id,'time_')]
B. //div[contains(@id_time())]
C. //div[parameter(@id_time())]
D. //div[parameter(@id,'time_')]
Answer : A
13. Select the Get command which fetches the inner text of the element that you specify in Web driver Selenium.
A. getinnerText()
B. get_in_Text()
C. get_inner_Text()
D. getText()
Answer : D
14. Which is the following is true in case of waitFor command?
A. waitForAlertPresent
B. waitForTextPresent
C. waitForFramePresent
D. waitForPageToLoad
Answer : B
15. Which command should be used to confirm that test will pass in the future, when new element is added after page loaded?
A. waitForElementPresent
B. pause
C. assertElementPresent
D. None of these
Answer : A
16. Select the language which is supported by The Selenium Web Driver
A. Perl
B. Sql
C. ASP
D. Cobol
Answer : A
17. The term AJAX expands to ________.
A. Asynchronous Java and XML
B. Asynchronous JavaScript and XML
C. Accumulated Java and XML
D. None of the above
Answer : B
18. Variable can be saved in which format?
A. ${variableName}
B. storedVars['variableName'].
C. Both of these
D. None of these
Answer : C
19. Select the operating system which is NOT supported by Selenium IDE.
A. Unix
B. Linux
C. Windows
D. Solaris
Answer : A
20. echo(): is used
A. to display the value of a variable in the log file, which can be very valuable for debugging.
B. Display the value of a variable named answer in the log file, what would the first argument to the previous command look like.
C. Both of these
D. None of these
Answer : C
21. In Selenium variables are stored in _________ .
A. storedVars
B. storedVariables
C. VariablesStore
D. All of the above
Answer : A
22. Method which selects the option which displays the text matching the parameter passed to it
A. selectVisibleText()
B. selectByVisibleText()
C. select_VisibleText()
D. select_ByVisibleText()
Answer : B
23. The Selenium RC is used
A. To run your test against different browsers (except HtmlUnit) on different operating systems.
B. To create tests with little or no prior knowledge in programming.
C. To test a web application against Firefox only.
D. To run a huge test suite, that can be executed on multiple machines.
Answer : A
24. How to execute specific command?
A. Highlight a command. Press Ctrl + F9.
B. Highlight a command. Press Alt + F9.
C. Highlight a command. Press Ctrl + X.
D. Highlight a command. Press X.
Answer : D
25. Select the command which is used to check the presence of a certain element.
A. verifyTable
B. verifyTitlePresent
C. verifyTextPresent
D. verifyElementPresent
Answer : D
26. In Selenium, Following Axis is related to:
A. Selects all the siblings after the current element
B. Selects all elements that follow the closing tab of the current elements.
C. Selects all of the siblings before the current element
D. Selects all elements that are before the current element
Answer : B
27. Select the command which is NOT used in verifying page elements .
A. verifyElementPresent
B. verifyElementRight
C. verifyElementNotPresent
D. verifyElementPositionLeft
Answer : B
28. Selenium is compatible with
A. CSS1.0 and CSS 2.0,
B. CSS1.0, CSS 2.0, and CSS 3.0 selectors.
C. CSS 2.0, and CSS 3.0 selectors.
D. CSS1.0, CSS 2.0, CSS 3.0 and CSS 4.0 selectors.
Answer : B
29. Select the command which retrieves the alert message and stores it in a variable that you will specify.
A. storeAlert
B. storedAlert
C. store_Alert
D. storesAlert
Answer : A
30. Select the command which is used to pause execution until the specified element becomes present.
A. waitForElementPresent
B. waitForPagePresent
C. waitForTablePresent
D. waitForFieldPresent
Answer : A
31. The Selenium
A. Provides professional customer support
B. Test Reports are generated automatically
C. Comes with a built-in object repository
D. Cannot access elements outside of the web application under test
Answer : D
32. By Default time of WAITFOR command is :
A. 15 sec
B. 20 sec
C. 25 sec
D. 30 sec
Answer : D
33. Select the command which is used to compare the actual page title with an expected value.
A. verifyTitle
B. verifiedTitle
C. verifyTitles
D. verifiedTitles
Answer : A
34. The test language usually used in Selenium is ________________.
A. PHP
B. Python
C. JavaScript
D. None of the above
Answer : C
35. In regular Expression * quantifier refers to:
A. 0 or more of the preceding character.
B. 1 or more of the preceding character
C. 0 or 1 of the preceding character
D. All of these
Answer : A
36. The // tells the query that
A. It needs to stop at the first element that it finds.
B. This is comment
C. The path of the file or folder
D. All of these
Answer : A
37. The term JSON refers to ______________.
A. JavaScript Object Notation
B. Java Object Notation
C. Java Object Naming
D. None of the above
Answer : A
38. Is Web Driver a component of the Selenium?
A. No
B. Yes
C.
D.
Answer : B
39. Variable can be saved in which format?
A. ${variableName}
B. storedVars['variableName'].
C. Both of these
D. None of these
Answer : C
40. Which command is used to extend the time limit of WAITFOR command?
A. Extend waitFor (time in sec)
B. waitFor (time in sec) extend
C. setTimeout (time in sec)
D. setTimeout.
Answer : D
41. Select the variation which finds elements based on the driver's underlying CSS selector engine in Web driver Selenium.
A. By.cssSelected
B. By.cssSelection
C. By.cssSelector
D. By.Selectcs
Answer : C
42. Select the command which is NOT a type of assertion in Selenium IDE.
A. Assert
B. Verify
C. WaitFor
D. Wait
Answer : D
43. What is the default port number used by hub in selenium?
A. 4444
B. 2222
C. 1111
D. 3333
Answer : A
44. Select the variation which locates elements by the value of their id� attribute in Web Driver Selenium
A. By.id
B. By.idno
C. By.id_no
D. By.tag_id
Answer : A
45. What is TestNG?
A. TestNextGeneration
B. TestNewGenerlization
C. TestNewGeneration
D. TestNextGenerations
Answer : A
46. Select the component which is NOT part of Selenium suite.
A. Selenium IDE
B. Selenium RC
C. SeleniumGrid
D. Selenium Web
Answer : D
47. Select the command which is used to print a string value or a variable in Selenium IDE.
A. The 'display' command
B. The 'echo' command
C. The 'print' command
D. The 'printr' command
Answer : B
48. To delete a cookie we need to call the deleteCookie method, passing in two parameters.
A. The first parameter is the name of the cookie, and the second parameter is where it was created.
B. The first parameter is where it was created, and the second parameter is the name of cookie.
C. None of these
D. All of the above
Answer : A
49. Select the command which is used to pause execution until the page is loaded completely.
A. waitForPageToLoad
B. waitForElementPresent
C. waitForPage
D. waitForLoad
Answer : A
50. What does the term DOM refers to ?
A. Dynamic Object Model
B. Document Object Model
C. Data Object Model
D. Document Flow Object Model
Answer : B

Sharing is caring