Testing
Testing
a) A testing framework
b) A web server
c) A programming language
Answer: a
Answer: c
Answer: a
Answer: b
Answer: d
6. Which Selenium tool would you use to test a web page without writing code?
a) Selenium IDE
b) Selenium WebDriver
c) Selenium API
d) Selenium Grid
Answer: a
Answer: c
8. Which method in Selenium is used to locate a web element by its ID?
a) getElementByAttribute
b) findElementById
c) findElementByTag
d) findElementByClass
Answer: b
Answer: a
Answer: d
11. 11. Which method is used to send text to a text box in Selenium?
a) driver.typeText()
b) driver.setText()
c) driver.sendKeys()
d) driver.enterText()
Answer: c
Answer: a
Answer: b
Answer: b
Answer: c
Answer: d
17. How can you check if an element is present on the page in Selenium?
a) element.isDisplayed()
b) driver.findElement()
c) driver.isElementPresent()
d) element.isPresent()
Answer: a
Answer: b
19. Which command is used to get the URL of the current page in Selenium?
a) driver.getPageURL()
b) driver.currentURL()
c) driver.getCurrentUrl()
d) driver.getURL()
Answer: c
Answer: c
Answer: b
Answer: b
Answer: c
32. What is the main advantage of Manual Testing over Automation Testing?
a) Elimination of human error
b) Ability to test non-scripted scenarios
c) Cost efficiency for large-scale tests
d) Faster execution of tests
Answer: b
Answer: a
Answer: c
Answer: b
a) Selenium IDE
b) Selenium Grid
c) Selenium RC
d) Selenium Server
Answer: d
a) Python
b) Java
c) Ruby
d) Swift
Answer: d
45. In which mode does Selenium operate to run tests?
a) Headless mode
Answer: c
a) Facebook
b) Google
c) ThoughtWorks
d) Microsoft
Answer: c
a) Safari
b) Internet Explorer
c) Opera
d) Firefox
Answer: c
Answer: b
a) Selenium WebDriver
b) Selenium IDE
c) Selenium Grid
d) Selenium RC
Answer: b
50.In Selenium WebDriver, which method is used to navigate to a specific URL?
a) driver.getUrl("http://example.com")
b) driver.navigate("http://example.com")
c) driver.visit("http://example.com")
d) driver.get("http://example.com")
51. A Selenium test script fails because it cannot find an element on the page. What is the most likely cause?
a) The web page takes too long to load, and the element is not yet available
Answer: a
a) Selenium Grid
b) Selenium IDE
c) Selenium WebDriver
d) Selenium RC
Answer: a
Answer: c
a) Selenium Grid
b) Selenium RC
c) Selenium IDE
d) Selenium Server
Answer: b
a) Selenium IDE
b) Selenium Grid
c) Selenium RC
d) Selenium WebDriver
Answer: a
a) Through APIs
Answer: d
Answer: b
a) GeckoDriver
b) SafariDriver
c) ChromeDriver
d) EdgeDriver
Answer: c
Answer: a
a) WindowSwitcher
b) BrowserManager
c) WindowHandler
d) WindowHandles
Answer: d
a) WindowSwitcher
b) BrowserManager
c) WindowHandler
d) WindowHandles
Answer: b
62. A test fails due to a timeout while interacting with a webpage. What is a possible solution?
Answer: a
63. A Selenium Grid setup fails to execute tests across nodes. What could be the issue?
Answer: b
64. Which of the following is required to run Selenium WebDriver tests on Chrome?
a) GeckoDriver
b) SafariDriver
c) ChromeDriver
d) WebDriverManager
Answer: c
Answer: c
66. In which programming language is the Selenium WebDriver API primarily developed?
a) Python
b) Java
c) JavaScript
d)Ruby
Answer: b
67. Which method is used to initialize WebDriver in Java for Chrome?
a) new ChromeDriver()
b) driver.start()
c) driver.init()
d) ChromeDriver.initialize()
Answer: a
68. Which file type is typically used to configure Selenium WebDriver dependencies in a Java Maven project?
a) .exe
b) .properties
c) .xml
d) .json
Answer: c
69. Which of the following environment variables must be set for Selenium to locate ChromeDriver?
a) PATH
b) JAVA_HOME
c) SELENIUM_HOME
d) CHROME_DRIVER_PATH
Answer: a
70. What is the purpose of adding drivers like ChromeDriver to the system PATH?
Answer: a
a) os.path.insert(ChromeDriver)
b) driver.add_path()
c) driver.executable_path
d) driver.start()
Answer: c
72. In a Maven project, where do you add Selenium dependencies to integrate Selenium WebDriver?
a) In pom.xml under
b) In test.java file
c) In environment variables
d) In an external file
Answer: a
73. A Selenium test fails to run due to missing ChromeDriver. What is a likely solution?
a) Reinstall Chrome
Answer: b
74. The Chrome browser does not open when running a Selenium script. What should you check first?
Answer: a
75. A test fails after updating ChromeDriver, citing version mismatch. What is the solution?
b) Rollback ChromeDriver
d)Run on Firefox
Answer: c
a) findElement(By.tag)
b) findElement(By.name)
c) findElement(By.id)
d) findElement(By.cssSelector)
Answer: c
Answer: b
78. Which locator is recommended for selecting elements with unique identifiers?
a) XPath
b) CSS Selector
c) Class Name
d) ID
Answer: d
a) A single WebElement
b) A list of WebElements
c) A string
d) A boolean
Answer: b
80. Which locator should you use when elements have no unique attributes, but specific text?
a) Name
b) Tag Name
c) Link Text
d) ID
Answer: c
Answer: b
a) driver.findElement(By.cssSelector())
b) driver.findElement(By.className())
c) driver.findElement(By.tagName())
d) driver.findByClass()
Answer: b
83. How would you locate an element with the XPath //button[text()='Submit']?
a) findElement(By.id("Submit"))
b) findElement(By.xpath("//button[text()='Submit']"))
c) findElement(By.tag("Submit"))
d) findByText("Submit")
Answer: b
84. Which Selenium method would you use to select an element using its CSS selector?
a) findElement(By.cssSelector())
b) findElement(By.name())
c) findElement(By.linkText())
d) findElement(By.tagName())
Answer: a
85. How would you locate the third <div> element using XPath?
a) //div[3]
b) //div[@id='3']
c) findElement(div, 3)
d) //div(3)
Answer: a
86. A Selenium script fails to locate an element by ID. What is the first check to perform?
Answer: a
87. The script fails intermittently when locating elements with dynamic IDs. What could be a solution?
a) Use findElement(By.id())
Answer: d
88. An element is not found during testing because it loads slowly. What is a potential fix in Selenium?
Answer: b
Answer: b
90. Which method is used to close the current browser window in Selenium WebDriver?
a) driver.quit()
b) driver.stop()
c) driver.close()
d) driver.exit()
Answer: c
d) Navigates to a URL
Answer: a
92. Which Selenium method is used to retrieve the title of the current webpage?
A ) driver.getText()
b) driver.getTitle()
c) driver.getHeading()
d) driver.getPageTitle()
Answer: b
b) To switch tabs
d) To take a screenshot
Answer: c
94. Which method would you use to navigate back to the previous page in Selenium WebDriver?
a) driver.forward()
b) driver.navigate().back()
c) driver.previousPage()
d) driver.back()
Answer: b
95. How do you retrieve the current URL of a page in Selenium WebDriver?
a) driver.getPageURL()
b) driver.getUrl()
c) driver.getCurrentUrl()
d) driver.get()
Answer: c
96. Which method would you use to clear text from an input field in Selenium WebDriver?
a) element.clearText()
b) element.delete()
c) element.clear()
d)element.removeText()
Answer: c
a) driver.captureScreenshot()
b) driver.takeScreenshot()
c) driver.getScreenshotAs()
d) driver.saveScreen()
Answer: c
a) element.select()
b) element.toggle()
c) element.click()
d) element.activate()
Answer: c
99. A Selenium test script fails with a "NoSuchElementException" error. What could be the cause?
c) Outdated ChromeDriver
Answer: a
100. The browser does not navigate to a URL provided in driver.get(). What could be the reason?
a) URL is incorrect
Answer: a
101. A script encounters a "StaleElementReferenceException." What does this imply in Selenium WebDriver?
Answer: b
Answer: a
103. What is the difference between vulnerability scanning and penetration testing?
Answer: a
104. Which of the following is NOT a phase of the penetration testing process?
a) Planning
b) Scanning
c) Enumeration
d) Analysis
Answer: d
105. Which of the following is the best approach to conducting a penetration test?
Answer: C.
a) A vulnerability is a weakness in a system while an exploit is a tool used to attack the system
b) A vulnerability is an attack on a system while an exploit is a weakness in the system
c) A vulnerability is a hardware issue while an exploit is a software issue
Answer: a
107. What is the purpose of social engineering in a penetration test?
Answer: c
Answer: c
109. What is the difference between a white hat hacker and a black hat hacker?
a) White hat hackers are ethical hackers while black hat hackers are unethical hackers
b) White hat hackers are hired by organizations to conduct penetration testing while black hat hackers are hired by
attackers to conduct malicious activities
c) White hat hackers are government-sponsored hackers while black hat hackers are independent hackers
d) White hat hackers use legal and ethical methods while black hat hackers use illegal and unethical methods
Answer: a
Answer: c
Answer: a
Answer: b
Answer: b
Answer: a
Answer: b
a) big-bang
b) top down
c) bottom up
d) functional incrimination
Answer: a
a) Planning
b) Kick of
c) Preparation
d) Review meeting
Answer: a
119. Which axis name in Selenium is related to the selection of all the parent, grandparent and so on?
a) Ancestor
b) Preceding
c) Parent
d) All of these.
Answer: a
a) white box
b) glass box
c) structural
d) functional
Answer: d
Answer: a
a) Test Case
b) Requirements Traceability Matrix [RTM]
c) Test strategy
d) Project Initiation Note [PIN]
Answer: d
123. Which of the following is not a valid phase of SDLC (Software Development Life Cycle)?
a) Testing Phase
b) Requirement Phase
c) Deployment phase
d) Testing closure
Answer: d
a) Structural testing
b) Error guessing technique
c) Design based testing
d) None of the above
Answer: a
125. Which of the following testing is related to the boundary value analysis?
Answer: c
Answer: d
a) Integration testing
b) Unit testing
c) System testing
d) All of the above
Answer: d
128. Which of the following is not a part of STLC (Software Testing Life Cycle)?
a) Testing Planning
b) Requirement Gathering
c) Test Design
d) Testing closure
Answer: b
a) Test type
b) Test Execution Level
c) Test Level
d) Test design technique
Answer: b
Answer: a
Answer: b
Answer: a
Answer: a
Answer: a
135. ______ is / are not a Iterative Model.
a. V model
b. Incremental
c. RAD
d. Spiral Model
Answer: a
Answer: a
Answer: c
Answer: b
Answer: d
Answer: d
Answer: d
Answer: a
Answer: a
Answer: d
Answer: c
146. A test technique that includes testing with differenet ranges of valid and invalid inputs a particular module or
component functionality extensively is known as?
a. Monkey Testing
b. Gorilla Testing
c. Agile Testing
d. Baseline Testing
Answer: b
Answer: c
Answer: a
Answer: a
Answer: c
Answer: b
Answer: b
a) Test execution
b) Test planning
c) Requirement analysis
d) Bug reporting
Answer: c
Answer: a
a) It is automated
b) It requires human intuition
c) It is predefined
d) It ensures regression testing
Answer: b
156. What is ad-hoc testing?
Answer: a
a) It is time-consuming
b) It can’t detect functional defects
c) It is expensive
d) It replaces automation
Answer: a
Answer: c
159. Which of the following components should a well-written test case include?
Answer: a
160. A tester finds a defect that occurs intermittently. What should the tester do?
a) Ignore it if rare
b) Document all observed conditions
c) Fix it immediately
d) Wait for it to occur again
Answer: b
Answer: b
a) Testing
b) Planning
c) Deployment
d) Maintenance
Answer: b
163. Which SDLC phase involves writing the code for the software?
a) Maintenance
b) Design
c) Implementation
d) Testing
Answer: c
Answer: a
165. Which SDLC model is best suited for projects with well-defined requirements?
a) Waterfall
b) Agile
c) V-Model
d) Spiral
Answer: a
Answer: b
167. What distinguishes the Spiral model from other SDLC models?
a) Focus on documentation
b) Emphasis on risk analysis
c) Absence of testing
d) Strict sequential flow
Answer: b
168. Which SDLC phase involves creating system and software design specifications?
a) Planning
b) Design
c) Testing
d) Maintenance
Answer: b
169. Which artifact is typically produced in the Requirement Analysis phase of SDLC?
a) Test Plan
b) Requirement Specification Document (RSD)
c) Code Snippets
d) Deployment Plan
Answer: b
170. During the Maintenance phase, a software bug is reported. What should be the first step?
Answer: b
Answer: b
a) Usability testing
b) Regression testing
c) Unit testing
d) System testing
Answer: a
a) Integration testing
b) Unit testing
c) System testing
d) Acceptance testing
Answer: b
Answer: b
Answer: b
a) Regression testing
b) System testing
c) Unit testing
d) Acceptance testing
Answer: b
177. Which of the following is NOT a non-functional testing type?
a) Performance testing
b) Security testing
c) Regression testing
d) Compatibility testing
Answer: c
178. Which testing type would most likely require test cases written for login functionality?
a) Load testing
b) Unit testing
c) Functional testing
d) Performance testing
Answer: c
179. During stress testing, how would you simulate a scenario exceeding the system's capabilities?
Answer: a
180. During load testing, the application crashes under expected user load. What should be done first?
Answer: b
181. In regression testing, a previously fixed defect reappears. What should the tester do?
a) Ignore it
b) Reopen the defect
c) Report it as a new issue
d) Wait for confirmation from the developer
Answer: b
a) driver.switchTo().window()
b) driver.switchTo().tab()
c) driver.getWindowHandle()
d) driver.selectWindow()
Answer: a
a) isChecked()
b) isSelected()
c) isClicked()
d) getValue()
Answer: b
184. Which Selenium command is used to retrieve the attribute value of a web element?
a) element.getText()
b) element.getValue()
c) element.getAttribute()
d) element.getProperties()
Answer: c
Answer: b
Answer: a
a) driver.alert().accept()
b) driver.switchTo().alert().accept()
c) driver.alertAccept()
d) driver.confirmAlert()
Answer: b
188. Which method is used to select an option by visible text in a dropdown list?
a) selectByValue()
b) selectByIndex()
c) selectByVisibleText()
d) selectText()
Answer: c
189. In Selenium WebDriver, how do you simulate pressing the Enter key?
a) sendKeys(Keys.ENTER)
b) driver.click(Keys.Enter)
c) driver.type(Keys.Enter)
d) pressEnter()
Answer: a
190. How can you perform a double-click action on an element in Selenium WebDriver?
a) action.doubleClick(element)
b) element.doubleClick()
c) element.click(2)
d) driver.doubleClick()
Answer: a
191. A test fails with a "NoAlertPresentException" error. What could be the cause?
Answer: a
192. A script fails when trying to select an option from a dropdown. What could be a likely solution?
Answer: b
Answer: a
Answer: b
195. Which type of wait applies to all elements and is set once in Selenium WebDriver?
a) Explicit Wait
b) Thread.sleep
c) Implicit Wait
d) Fluent Wait
Answer: c
196. What is the advantage of using Explicit Wait over Implicit Wait?
a) It’s faster
b) It allows waiting for specific conditions
c) It applies to all elements
d) It doesn’t require imports
Answer: b
a) Element to be editable
b) Element to load
c) Browser to close
d) Page title to update
Answer: a
198. What is TestNG primarily used for in Selenium?
a) Browser automation
b) Test case management
c) Java development
d) Data analysis
Answer: b
a) new Page(driver)
b) driver.getPage()
c) driver.load(Page.class)
d) Page page = new Page(driver)
Answer: d
a) @DataProvider
b) @FindBy
c) @Test
d) @Locator
Answer: b