Selenium Interview Questions and Answers
Freshers / Beginner level questions & answers
Ques 1. What is test automation or automation testing?
Automation testing uses automation tools to write and execute test cases, no manual involvement is necessary for executing an automated test suite. Testers prefer automation tools to write test scripts and test cases and then group into test suites.
PLAN -> CODE -> BUILD -> TEST -> RELEASE -> DEPLOY -> OPERATE -> MONITOR
Automation testing enables the use of specialized tools to automate the execution of manually designed test cases without any human intervention. Automation testing tools can access the test data, controls the execution of tests and compares the actual result against the expected result. Consequently, generating detailed test reports of the system under test.
Ques 2. What are the advantages of automation testing?
Some basic Advantages of automation testing are as follows.
- Automation testing supports both functional and performance test on an application.
- It supports the execution of repeated test cases.
- It facilitates parallel execution.
- It aids in testing a large test matrix.
- It improves accuracy because there are no chances of human errors.
- It saves time and money.
Ques 3. Name some of the commonly used Automation Testing tools that are used for Functional Automation.
Lists of top 10 used automation testing tools for Functional Automation are as follows.
- Teleric Test Studio, Developed by Teleric.
- TestingWhiz
- HPE Unified Functional Testing (HP - UFT formerly QTP)
- Tosca Testsuite
- Watir
- Quick Test Professional, provided by HP.
- Rational Robot, provided by IBM.
- Coded UI, provided by Microsoft.
- Selenium, open source.
- Auto It, Open Source.
Ques 4. Name some of the commonly used Automation Testing tools that are used for Non-Functional Automation.
Lists of some commonly used Automation Testing tools for Non-Functional Automation are as follows.
- Load Runner, provided by Hp.
- JMeter, provided by Apache.
- Burp Suite, provided by PortSwigger.
- Acunetix, provided by Acunetix.
Ques 5. What is Selenium?
Selenium is a portable framework for software testing. Selenium tool facilitates with a playback tool for authoring functional tests without the need to learn a test scripting language.
Selenium is one of the most widely used open source Web UI (User Interface) automation testing suite. Jason Huggins developed Selenium in 2004 as an internal tool at Thought Works. Selenium supports automation across different browsers, platforms, and programming languages.
Ques 6. What are the different components of Selenium?
Selenium is not just a single tool but a suite of software's, each having a different approach to support automation testing. It comprises of four major components which include:
- Selenium Integrated Development Environment (IDE)
- Selenium Remote Control (Now Deprecated)
- WebDriver
- Selenium Grid
Ques 7. List out the names of programming languages, browsers and operating systems that are supported by Selenium.
Selenium supports various operating systems, browsers and programming languages. Following is the list:
- Programming Languages: C#, Java, Python, PHP, Ruby, Perl, JavaScript.
- Operating Systems: Android, iOS, Windows, Linux, Mac, Solaris.
- Browsers: Google Chrome, Mozilla Firefox, Internet Explorer, Edge, Opera, Safari, etc.
Ques 8. What are the significant changes/upgrades in various Selenium versions?
Selenium v1.0:
- Version 1.0 was the initial release of Selenium.
- It included three tools: Selenium IDE, Selenium RC, and Selenium Grid.
Selenium v2.0:
- Selenium WebDriver was introduced replacing Selenium RC in version "2.0".
- With the onset of WebDriver, RC got deprecated and moved to the legacy package.
Selenium v3:
- The latest release Selenium 3 has new added features and functionalities.
- It includes Selenium IDE, Selenium WebDriver, and Selenium Grid.
Ques 9. List some of the test types that are supported by Selenium.
Different types of testing's that we can achieve through Selenium are.
- Functional Testing
- Regression Testing
- Sanity Testing
- Smoke Testing
- Responsive Testing
- Cross Browser Testing
- UI testing (black box)
- Integration Testing
Ques 10. What is Selenium IDE?
Selenium IDE is implemented as Firefox extension which provides record and playback functionality on test scripts. It allows testers to export recorded scripts in many languages like HTML, Java, Ruby, RSpec, Python, C#, JUnit and TestNG.
Selenium IDE has limited scope, and the generated test scripts are not very robust, and portable.
Ques 11. What do you mean by Selenese?
Selenium commands, also known as "Selenese" are the set of commands used in Selenium that run your tests. For example, command - open (URL); launches the desired URL in the specified browser and it accept both relative and absolute URLs.
A sequence of Selenium commands (Selenese) together is known as a test script.
Ques 12. What are the different ways of locating a web element in Selenium?
In Selenium, web elements are identified and located with the help of Locators. Locators specify a target location which uniquely defines the web element in the context of a web application. Thus, to identify web elements accurately and precisely we have different types of locators in Selenium:
- ID
- ClassName
- Name
- TagName
- LinkText
- PartialLinkText
- Xpath
- CSS Selector
- DOM
Ques 13. How many types of WebDriver API's are available in Selenium?
The list of WebDriver API's which are used to automate browser include:
- AndroidDriver
- ChromeDriver
- EventFiringWebDriver
- FirefoxDriver
- HtmlUnitDriver
- InternetExplorerDriver
- iPhoneDriver
- iPhoneSimulatorDriver
- RemoteWebDriver
Ques 14. List out some of the Automation tools which could be integrated with Selenium to achieve continuous testing.
Selenium can be used to automate functional tests and can be integrated with automation test tools such as Maven, Jenkins, &Docker to achieve continuous testing. It can also be integrated with tools such as TestNG, &JUnit for managing test cases and generating reports.
Ques 15. What do you mean by the assertion in Selenium?
The assertion is used as a verification point. It verifies that the state of the application conforms to what is expected. The types of assertion are "assert", "verify" and "waitFor".
Ques 16. Explain the difference between assert and verify commands?
Assert: Assert command checks if the given condition is true or false. If the condition is true, the program control will execute the next phase of testing, and if the condition is false, execution will stop, and nothing will be executed.
Verify: Verify command also checks if the given condition is true or false. It doesn't halt program execution, i.e., any failure during verification would not stop the execution, and all the test phases would be executed.
Ques 17. What is the difference between "/" and "//" in XPath?
Single Slash "/": Single slash is used to create XPath with absolute path.
Double Slash "//": Double slash is used to create XPath with the relative path.
Ques 18. What are the different types of annotations which are used in Selenium?
JUnit annotations which can be used are:
- Test
- Before
- After
- Ignore
- BeforeClass
- AfterClass
- RunWith
Ques 19. What are the WebDriver supported Mobile Testing Drivers?
WebDriver supported "mobile testing drivers" are:
- AndroidDriver
- IphoneDriver
- OperaMobileDriver
Ques 20. What are the popular programming languages supported by Selenium WebDriver to write Test Cases?
Selenium WebDriver supports the below languages to write Test Cases.
- JAVA
- PHP
- Python
- C#
- Ruby
- Perl
Ques 21. What is the difference between type keys and type commands?
TypeKeys() will trigger JavaScript event in most of the cases whereas .type() won't.
Ques 22. How to invoke an application in WebDriver?
driver.get("url"); or
driver.navigate().to("url");
Most helpful rated by users:
Related interview subjects
Cucumber interview questions and answers - Total 30 questions |
QTP interview questions and answers - Total 44 questions |
TestNG interview questions and answers - Total 38 questions |
Postman interview questions and answers - Total 30 questions |
SDET interview questions and answers - Total 30 questions |
Selenium interview questions and answers - Total 40 questions |
Kali Linux interview questions and answers - Total 29 questions |
Mobile Testing interview questions and answers - Total 30 questions |
UiPath interview questions and answers - Total 38 questions |
Quality Assurance interview questions and answers - Total 56 questions |
API Testing interview questions and answers - Total 30 questions |
Appium interview questions and answers - Total 30 questions |
ETL Testing interview questions and answers - Total 20 questions |