Selenium Interview Questions & Answers - Learning Mode | |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|
Selenium Interview Questions & Answers - Learning ModeSelenium is a free (open source) automated testing suite for web applications across different browsers and platforms. It is quite similar to HP Quick Test Pro (QTP) only that Selenium focuses on automating web-based applications. Selenium is not just a single tool but a suite of software's, each catering to different testing needs of an organization. It has four components. Selenium Integrated Development Environment (IDE) Selenium Remote Control (RC) WebDriver Selenium Grid. |
|
Try Selenium Interview Questions & Answers - Exam Mode | |
Selenium Interview Questions & Answers - Learning Mode |
Try Selenium Interview Questions & Answers - Exam Mode |
Question: What are the disadvantages of xPath locator as compared to cssSelector locator?
Answer: Following is the list of disadvantages of xPath locator as compared to cssSelector locator: 1. xPath is slower than cssSelector locator. 2. Every browser reads xPath in different way. e.g, some browsers lie IE reads only lower-cased tag name and attribute Name. So if used in upper case then it will work in Firefox browser but will not work in IE browser. So we cannot use XPath locators for cross browser testing using selenium WebDriver software testing tool. Source: CoolInterview.com |
Question: What is Selenium?
Answer: Selenium is an open source automated testing tool to test web applications released under Apache 2.0 license. Source: CoolInterview.com |
Question: What is Selenium IDE?
Answer: Selenium IDE is the simplest and easiest of all the tools within the Selenium Package. Its record and playback feature makes it exceptionally easy to learn with minimal acquaintances to any programming language. Selenium IDE is an ideal tool for a na? user. Source: CoolInterview.com |
Question: Explain setSize method of selenium webdriver software testing tool?
Answer: setSize method of selenium webdriver software testing tool is used to set the size of browser window. The following command set the size of browser window to 500 x 500. driver.manage().window().setSize(new Dimenson(500,500)); Source: CoolInterview.com |
Question: What is TestNG Soft Assertion in selenium webdriver software testing tool?
Answer: Using TestNG soft assertion, we can continue our test execution even if assertion fails. That means on failure of soft assertion, remaining part of @Test method will be executed and assertion failure will be reported at the end of @Test method. Source: CoolInterview.com |
Question: What command simulates selecting the browser's Back button in Selenium IDE?
Answer: goBack command Source: CoolInterview.com |
Question: What are different assertions supported by JUnit?
Answer: List of JUnit assertions as bellow. assertEquals assertFalse assertTrue assertNull assertNotNull assertSame assertNotSame assertArrayEquals Source: CoolInterview.com |
Question: What is the difference between setSize() and getSize()method?
Answer: window().setSize() method is used to set the size of window in selenium webdriver software test.e.g: driver.manage().window().setSize(new Dimension(300,500)); The above syntax is used set window width to 300 and height to 500. window().getSize() method is used to get size of window. E.g.: driver.manage().window().getSize().getHeight() The above syntax will return window height. driver.manage().window().getSize().getWidth() The above syntax will return window Source: CoolInterview.com |
Question: What is the usage of setting priority of @Test method?
Answer: In test case we can set priority for TestNG @Test annotated methods as bellow. @Test(priority=0) By using priority we can control @Test method execution manner as per our requirement. That means @Test method with priority = 0 will be executed 1st and @Test method with priority = 1 will be executed 2nd and so on. Source: CoolInterview.com |
Question: What is echo command in Selenium IDE?
Answer: Echo command is used to print content of Selenium variables. It is used for debugging test case. When "echo" command is executed, it will display current stored value of variable into Log area of selenium IDE software testing tool's window. Source: CoolInterview.com |
Question: What is the difference between setPosition() and getPosition()?
Answer: window().setPosition() to set position of window. E.g: We can set window position to 50 points from left side and 200 points from top side using bellow given syntax. driver.manage().window().setPosition(new Point(50,200)); window().getPosition() to get position of window Use window().getPosition().getX() to get window position from left side as bellow. driver.manage().window().getPosition().getX() To get window position from top side of screen, use window() Source: CoolInterview.com |
Question: What Is TestNG? Explain its functionalities that makes it powerful than other framework.
Answer: TestNG ("Testing, the Next Generation") is an open source Java unit testing framework that aims to overcome many limitations of JUnit and NUnit. Some new functionalities that make it more powerful and easier to use, such as: 1. JDK 5 Annotations: Annotations in TestNG are lines of code that can control how the method below them will be executed. 2. Flexible test configuration 3. Support for data-driven testing (with @DataProvider) 4. Support for parameters 5. Al Source: CoolInterview.com |
Question: What is Selenium Remote Control (RC) tool?
Answer: Selenium Remote Control (RC) is a server, written in Java, that accepts commands for the browser via HTTP. Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. The Java driver can also be used with JavaScript (via the Rhino engine). A new instance of selenium RC server is needed to launch html test case - which means that the port should Source: CoolInterview.com |
Question: What is Selenium 2?
Answer: Web testing tools Selenium RC and WebDriver are merged in single tool in Selenium 2.0 Source: CoolInterview.com |
Question: What is the difference between verify and assert commands?
Answer: Assert: Assert allows to check whether an element is on the page or not. The test will stop on the step failed, if the asserted element is not available. In other words, the test will terminated at the point where check fails. Verify: Verify command will check whether the element is on the page, if it is not then the test will carry on executing. In verification, all the commands are going to run guaranteed even if any of test fails. Source: CoolInterview.com |
Question: Can I test mobile application using selenium? or Can I use Selenium for automating Mobile Apps?
Answer: Selenium mobile testing is now a reality. Appium, a new open source framework is designed to bring the same Selenium testing experience to the world of mobile testing. It is based on the WebDriver JSON Wire Protocol and on a subset of the Selenium API. Source: CoolInterview.com |
Question: What method is used to capture screenshot in Selenium WebDriver software testing tool?
Answer: TakesScreenshot method is used to capture screenshot. Java File class will be used to store screenshot in your system's local drive. Source: CoolInterview.com |
Question: What are the steps to build test case in Selenium IDE?
Answer: To build test cases we will need following 3 steps: 1. Recording: Whenever we open Selenium IDE by default Record button is on. If you don't want to start recording automatically you need to go to options and deselect ?Start recording immediately on open.? Based on user actions on browser the tool will record the actions and insert commands in the test case. The common commands are click, clickAndWait, type, select commands. 2. Adding Verifications and Asserts With the Context Source: CoolInterview.com |
Question: Which Time unit we provide on @Test method level or test suite level?
Answer: milliseconds Source: CoolInterview.com |
Question: What functions are used in XPath to do partial match on attribute value from beginning?
Answer: contains() starts-with() Source: CoolInterview.com |
India News Network |