Ans: Automation testing is used to automate the manual testing. It is a process of automating the manual process to test the application/system under test. It uses separate testing tools which facilitate you to create test scripts which can be executed repeatedly and doesn't need any manual intervention.
Ans:
Ans: Selenium is one of the most popular automated testing suites. It is browser automation tool which lets you automated operations like click, type and selection from a drop down of a web page. It is designed to support and encourage automation testing of functionalities of web based applications and a wide range of browsers and platforms. It is one of the most accepted tools amongst the testing professional due to its existence in the open source community.
Selenium is not just a single tool rather than it is a package of several testing tools and that?s why it is referred as a suite. Each of these tools is designed to cater different testing and test environment requirement.
Ans: Selenium 1.0 is popularily known as Selenium Remote Control (Selenium RC). It is a library available in wide variety of languages. The main reason to use Selenium RC was that Selenium IDE was incapable to execute tests in browsers other than Selenium IDE and the limitation of language Selenese used in Selenium IDE.
Ans: Selenium IDE is a firefox plug-in. It is used to record and replay tests in firefox browser. It is used only with firefox browser.
Ans: Selenium 2.0 is a tool which is a combination of web testing tools Selenium RC and WebDriver.
Ans: Selenium is used as a testing tool because:
Ans: Selenium supports two types of testing:
Ans: Selenium has following limitations:
Ans: Selenese is a lanuage which is used for writing test script in selenium IDE.
Ans: Locator is an address which identifies a web element uniquely within the web page.
There are different types of locators in Selenium to identify web elements accurately and precisely.
These are:
Ans: Xpath is used to locate a web element based on its XML path. It can be used to locate HTML elements.
Ans: The latest Selenium tool is WebDriver.
Ans: These are the different drivers available in WebDriver:
Ans: JUnit annotations which can be used are:
Ans: Selenium Grid facilitates you to distribute your tests on multiple machines and all of them at the same time. So, you can execute tests on Internet Explorer on Windows and Safari on Mac machine using the same text script. It reduces the time of test execution and provides quick feedback.
Ans: The result of test execution is displayed in a Log Window in Selenium IDE.
Ans: Yes, tests in Selenium IDE can be edited. There are two ways to edit tests in Selenium IDE.
Ans: Yes, You can use html id and name as it is available in Selenium IDE.
Ans: WebDriver supported "mobile testing drivers" are:
Ans:
Ans: 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 halts program execution i.e. any failure during verification would not stop the execution and all the test phases would be executed.
Ans: Single Slash "/": Single slash is used to create Xpath with absolute path.
Double Slash "//": Double slash is used to create Xpath with relative path.
Ans: Both methods can be used to navigate to a url but the driver.get() is a convenient way to navigate to a url. The driver.navigate() does the same function as the driver.navigate().to(?url?) but it also has other functions, such as:
Ans: Implicit Wait: In Implicit wait, if WebDriver cannot find an element in the Document Object Model (DOM), it will wait for a defined amount of time for the element to appear in the DOM. The Implicit wait may slow down your tests, because once set, the implicit wait is set for the life of the WebDriver object's instance.
An example of Implicit Wait:
Explicit Wait:
Explicit waits are better than implicit wait. Unlike an implicit wait, you can write custom code or conditions for wait before proceeding further in the code.
An explicit wait can be used where synchronization is needed, for example the page is loaded but we are still waiting for a call to complete and an element to appear.
An example of Implicit Wait:
Ans: TypeKeys() will trigger JavaScript event in most of the cases whereas .type() won't.
Ans: "type" command is used to type keyboard key values into text box of software web application. It can also be used for selecting values of combo box whereas "typeAndWait" command is used when your typing is completed and software web page start reloading. This command will wait for software application page to reload. If there is not page reload event on typing, you have to use simple "type" command.
Ans: Sleep() and setSleep() both methods are used to delay the speed of execution.
Thread.sleep (): It is used to stop the current (java) thread for the specified period of time. It's done only once.
SetSpeed (): It will stop the execution for every selenium command for specific amount of time.
Ans: find element (): It is used to find the first element within the current page using the given "locating mechanism". It returns a single WebElement.
findElements () : It uses the given "locating mechanism" to find all the elements within the current page. It returns a list of web elements.
Ans: To type in a text box, we use sendKeys("String to be entered") to insert string in the text box.
Syntax:
Ans: JUnit is an open source testing framework for java applications. It is introduced by Apache.
Ans: Annotation is a process of adding a special form of syntactic meta-data to Java source code. Variables, parameters, packages, methods and classes are annotated some of the JUnit annotations.
Ans: The four parameters that you have to pass in Selenium are:
Ans: The close() method closes the current browser only whereas quit() method closes all browsers opened by WebDriver.
Ans: The concept of waits is introduced by Selenium Webdriver for AJAX based application. There are two types of waits:
Ans: The main disadvantage of implicit wait is that it slows down test performance.
Another disadvantage of implicit wait is:
Suppose, you set the waiting limit to be 10 seconds and the elements appears in the DOM in 11 seconds, your tests will be failed because you told it to wait a maximum of 10 seconds.
Ans: You can use the isSelected() method to check if a check-box or radio button is selected.
Syntax:
Ans: You can do drag and drop in Selenium by using the following code:
Ans: isDisplayed() method is used to check if an element is visible on the page. The return type of this method is Boolean so, if it returns true, the element is visible otherwise it is not.
Ans: isEnabled() method is used to check if a button is enabled on a page. The return type of this method is Boolean so, if it returns true, the element is visible otherwise it is not.
Ans: Like other automation testing tools, selenium also facilitates you to record, edit and debug test cases. But there are some problems that affect the maintainability of recorded test cases. Sometimes it takes more time to maintain automated test cases than to perform manual testing. Another problem is complex id for an HTML element. If ID is auto generated, the recorder test cases can fail during playback.
Ans: These tools are:
Ans: Four parameters that have to be passed in selenium are:
Related Interview Questions...
Core Java Interview Questions And Answers
Core Java Programming Interview Questions and Answers
Multithreading in Java Interview Questions and Answers
Javascript Interview Questions
Java/J2EE Apps Integration Questions and Answers.
Java Collections Interview Question and Answers
Java Interview Questions and Answers
Java Web Services Interview Questions and Answers
Tricky Java Interview Questions and Answers