Explore topic-wise MCQs in Software Testing (MCQ) questions and answers.

This section includes 22 Mcqs, each offering curated multiple-choice questions to sharpen your Software Testing (MCQ) questions and answers knowledge and support exam preparation. Choose a topic below to get started.

1.

Which is not true in case of Globs, in Selenium?

A. Globs are used as default pattern matching technique.
B. It is similar to regular expressions.
C. The syntax of Globs is much wider than Regular expression.
D. Both B and C
Answer» D. Both B and C
2.

Which regular expression sequence loosely translates to "anything or nothing?"

A. .* (dot star)
B. *. (star dot)
C. ?
D. *+
Answer» B. *. (star dot)
3.

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» E.
4.

Variable can be saved in which format?

A. ${variableName}
B. storedVars['variableName'].
C. Both of these
D. None of these
Answer» D. None of these
5.

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» C. CSS 2.0, and CSS 3.0 selectors
6.

Which two commands you can use to validate a button?

A. VerifyTextPresent and assertTextPresent
B. VerifyElementPresent and assertElementPresent
C. VerifyAlertPresent and assertAlertPresent
D. VerifyAlert and assertAlert
Answer» C. VerifyAlertPresent and assertAlertPresent
7.

What is the default port number used by hub in Selenium?

A. 4444
B. 2222
C. 1111
D. 3333
Answer» B. 2222
8.

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» B. //div[contains(@id_time())]
9.

Which process will be used in JavaScript to find an element?

A. By DOM query
B. BY XPath query
C. BY CSS sector
D. All of these
Answer» B. BY XPath query
10.

Which of the following is not a verify and asserts method in Selenium?

A. VerifyElementPresent
B. VerifyElementNotPresent
C. VerifyText
D. VerifyTextAttributes
Answer» E.
11.

Which of the following is false in case of waitFor command?

A. waitForAlertPresent
B. waitForTextPresent
C. waitForFramePresent
D. waitForPageToLoad
Answer» D. waitForPageToLoad
12.

Which is not the advantage of Selenium IDE?

A. Intelligent field selection will use IDs, names, or XPath as needed.
B. Auto complete for all common Selenium commands
C. Support for Selenium user- extensions .jr file
D. None of these.
Answer» D. None of these.
13.

In Selenium variables are stored in _____________ .

A. storedVars
B. storedVariables
C. VariablesStore
D. All of the above
Answer» B. storedVariables
14.

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» E.
15.

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» B. This is comment
16.

By Default time of WAITFOR command is ______.

A. 15 sec
B. 20 sec
C. 25 sec
D. 30 sec
Answer» E.
17.

To delete a cookie we need to call the deleteCookie method and we are passing in two parameters, what are those 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. Both of these
D. None of these
Answer» B. The first parameter is where it was created, and the second parameter is the name of cookie.
18.

Applications do not have the items needed for the tests when the tests get to commands. To get around this, we had a look at adding for 'waitFor' commands to test. This is related to while ___________.

A. Debugging tests
B. Working with AJAX applications
C. Working with multiple windows
D. All of these
Answer» C. Working with multiple windows
19.

What is the most common way to find an element on a page?

A. ID
B. XPath
C. CSS selector
D. Name
Answer» B. XPath
20.

During which phase is the Entry Criteria determined?

A. Planning
B. Kick of
C. Preparation
D. Review meeting
Answer» B. Kick of
21.

Which command should be used to confirm that the test will pass in the future when the new element is added after the page is loaded?

A. waitForElementPresent
B. pause
C. assertElementPresent
D. None of these
Answer» B. pause
22.

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» B. Preceding