Selenium MCQ Quiz PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Selenium MCQ Quiz PDF

1. Which of the following is a syntax for an x path to find an element?

1. input[tagname='value']
2. a[value='attribute']
3. tagname[@attribute=`value`]
4. atribute[@tagname=`value`]

Answer: tagname[@attribute=`value`]

2. Which of the below file we use in Maven project?

1. pom.doc
2. poc.xml
3. com.xml
4. pom.xml

Answer: pom.xml

3. Which one uses to test server in Selenium?

1. Selenium RC
2. Selenium IDE
3. Selenium grid
4. Selenium Webdriver

Answer: Selenium RC

4. It is a record and playback tool in Selenium.

1. Selenium Webdriver
2. Selenium Grid
3. Selenium IDE
4. Selenium RC

Answer: Selenium IDE

5. Which method to use to get current page url?

1. getCurrentUrl()
2. getPageUrl()
3. getWebpageUrl()
4. getUrl()

Answer: getCurrentUrl()

6. Difference between quit() and close()?


1. quit() method quits all opened windows, close() method closes the active window
only.
2. quit() method closes all opened windows, close() method opens a browser session
3. quit() method quits the active window only, close() method closes the active window
4. quit() method quits the active window only, close() method closes all opened
windows.

Answer: quit() method quits all opened windows, close() method closes the active
window only

7. Which one is NOT features of Selenium?

1. can be tested windows based apps


2. has cross browser compatibility (chrome, Firefox)
3. free and open source
4. supports distributed testing

Answer: can be tested windows based apps

8. Which of the below are NOT a correct way of location element?

1. By.div
2. By.classname
3. By.partialtext
4. Both 1 & 3

Answer: Both 1 & 3

9. Which method should we use to launch a url?

1. get()
2. openUrl()
3. open()
4. startChrome()

Answer: get()

10. Which is the correct syntax of DOM?

1. $tag attr1=value1, attr2=value2$Text$/tag$


2. <tag attr1==value1, attr2==value2>Text</tag>
3. <tag attr1=value1, attr2=value2>Text</tag>
4. </tag attr1=value1, attr2=value2>Text</tag>

Answer: <tag attr1=value1, attr2=value2>Text</tag>

11. Which method to use to close a webpage? Hint

1. disconnect()
2. close()
3. quit()
4. Both 2 & 3

Answer: Both 2 & 3

12. Can be tested using Selenium_____________

1. ad hoc
2. functional testing
3. performance
4. stress

Answer: functional testing

13. Select the command which is used to pause execution until the page is loaded
complelety

1. waitForLoad
2. wait ForElementPresent
3. waitForPageToLoad
4. waitForPage

Answer: waitForPageToLoad

14. Which method to use to get an element from webpage?

1. getElement()
2. searchElement()
3. findElements()
4. findElement()

Answer: findElement()

15. Which is the correct order in software testing?

1. Acceptance, integration, Unit, System


2. Unit, System, Integration, Acceptance
3. Unit, Integration, System, Acceptance
4. Acceptance, System, Unit, Integration

Answer: Unit, Integration, System, Acceptance

16. What does the term regex expands to?

1. Regular Expression
2. Registered Expression
3. Regional Expression
4. Regression Expression

Answer: Regular Expression


17. What does the Selenium Tool suite comprise of?

1. WebDriver& Selenium IDE


2. WebDriver, Selenium IDE & Selenium Grid
3. WebDriver & Selenium Grid
4. WebDriver & Selenium RC

Answer: WebDriver & Selenium RC

18. What does a test suite made of ?

1. Test Packs
2. Test Pattern
3. Test Blocks
4. Tests

Answer: Tests

19. Which label is used as prefix patter to specify a globing pattern parameter for a
selenese command ?

1. Regex
2. Pattern
3. Globe
4. None

Answer: Glob

20. Which of below is NOT a web element type________

1. Selector
2. Drop Down
3. Check Box
4. Radio button

Answer: Selector

21. Which one is NOT one of the Selenium's suites?

1. Selenium RC
2. Selenium IDE
3. Selenium Web Driver Manager
4. Selenium Grid

Answer: Selenium Web Driver Manager

22. What does DOM stand for?

1. Document Object Matter


2. Document Object Model
3. Definitive Object Model
4. Database Object Model

Answer: Document Object Model

23. Which of the following is an instance of the Web driver Interface?

1. Chrome Driver
2. new Chrome Driver
3. WebDriver
4. new WebDriver

Answer: new Chrome Driver

24. What type of tests can we automate with Selenium?

1. Regression test
2. Load test
3. Security test
4. Performance test

Answer: Regression test

25. What does Selenium do?

1. tests mobile apps


2. tests web apps
3. tests captcha
4. tests barcode

Answer: tests web apps

26. Which of the following is not a language binding?

1. C#
2. Java
3. HTML
4. Python

Answer: HTML

27. What does the assert title check?

1. Block Title
2. Element title
3. Page title
4. Title of element under focus

Answer: Page title


28. Select the command which is used to compare the contents of a table with expected
values.

1. verifytable
2. verifytable data
3. verifytable cell
4. All of above

Answer: verifytable

29. The action command_________

1. are command that verify if a certain condition is met


2. are command that allow you to store value to a variable
3. are command thats directly interact with page elements
4. None of above

Answer: are command that directly interact with page elements

30. Which of the following is not an automation testing tool?

1. QTP/UFT
2. Katalon
3. Selenium
4. API

Answer: API

31. Which command can be used to enter values onto text boxes?

1. sendkeys()
2. sendkey()
3. sendkey
4. sendskeys

Answer: sendkeys()

32. What does DOM stands for?

1. Document Object Model


2. Discover Object Mechanism
3. Desktop Object Model
4. Data Object Matrix

Answer: Document Object Model

33. Select the command which is not a type of assertion in selenium IDE.

1. Verify
2. Assert
3. wait
4. waitfor

Answer: wait

34. Selenium IDE Stand for_____________

1. Selenium information Development Environment


2. Selenium Initialization Development Environment
3. Selenium interrelated Development Environment
4. Selenium integrated Development Environment

Answer: Selenium Integrated Development Environment

35. Which is the incorrect statement for X-path?

1. with Xpath, we can search elements backward or forward... while css works only in
forward direction
2. Xpath has more combination and can search by index CSS cannot search by index,
but css is working faster than Xpath
3. with Xpath we cannot work with text, CSS we can
4. Xpath can work with text, CSS cannot work

Answer: with Xpath we cannot work with text, CSS we can

36. Which one is NOT features of the Selenium?

1. supports many operating systems (Win, OS...)


2. supports mobile testing
3. supports multiple programming language
4. supports multi-browser testing

Answer: supports mobile testing

37. Method to get title of the page_______________

1. fetchTitle()
2. getPageTitle()
3. getWebTitle()
4. getTitle()

Answer: getTitle()

38. What is an explicit wait?

1. is a wait which waits for a specified time while locating an element before throwing
“No Such Element Exception.
2. wait which is applied to a particular web element until the Expected Condition
specified is met
3. wait which is applied to a particular web element until the Expected Condition
specified is met as well as the frequency
4. None of above

Answer: wait which is applied to a particular web element until the Expected Condition
specified is met

39. How do you maximize a web page?

1. driver.manage().window().maximize();
2. driver.manage().maximize();
3. driver.manage().enlarge
4. driver.manage().window().enlarge();

Answer: driver.manage().window().maximize();

40. Which syntax can be used to handle dynamic elements?

1. startwith( ) a//label[startwith(@id, `message`)]


2. text( ) a//td[text() = `usedId`]
3. contains( ) a //*[contains(@name=`btn`)]
4. All of above

Answer: All of above

You might also like