1. What is Automation Testing?
2. What are the benefits of Automation Testing?
Benefits of Automation testing are:3. Why should Selenium be selected as a test tool?
4. What is Selenium?
Selenium is one of the most commercial automated testing suites. Selenium is designed in a way to support and stimulate automation testing of functional aspects of web-based applications and a wide range of browsers and platforms.5. What are the testing types that can be supported by Selenium?
Selenium supports the following types of testing:6. What are the limitations of Selenium?
Following are the limitations of Selenium:7. How will you find an element using Selenium?
Everything has control in a web page which is introduced as an elements.There are different ways are
8. How to type in a textbox using Selenium?
User can use sendKeys(“String to be entered”) to enter the string in the textbox.Syntax: WebElement username = drv.findElement(By.id(“Email”)); //entering username username.sendKeys(“sth”);
9. What is Object Repository? How can we create Object Repository in Selenium?
The collection of web elements connected to Application under Test (AUT) along with their locator values is called Object Repository. Whenever the element is required within the script, the locator value can be occupy from the Object Repository and used to store locators in a centralized location instead of hard coding them within the scripts.10. How to click on a hyperlink using link Text?
driver.findElement(By.linkText(“Google”)).click();
The command finds the element using link text and then click on that element and thus the user would be redirected to the represented page. The above link can also be obtain by using the below command.
driver.findElement(By.partialLinkText(“Goo”)).click();
The above command find the element based on the substring of the link allocated in the parenthesis and thus partialLinkText() finds the web element with the define substring and then clicks on it.
11. What is the difference between driver.close() and driver.quitcommand?
close (): The web browser window that the user is currently working on can be closed by WebDriver’s close() method . The command neither requires any parameter nor does is return any value.quit (): Unlike close() method, the windows that the program has opened are closed by quit() method. The command neither essential on any parameter nor does it return any value.
12. How can we handle windows based pop up?
Selenium is an automation testing tool which supports only web application testing, that means, it doesn’t support testing of windows based applications. However Selenium alone can’t help the situation but along with some third party intervention, this problem can be overcome. There are various third party tools available for handling window based pop ups along with the selenium like AutoIT, Robot class etc.13. What is Junit?
Junit is a unit testing framework introduced by Apache. Junit is based on Java.14. What is a framework?
A constructive blend of various guidelines, coding standards, concepts, processes, practices, project hierarchies, modularity, reporting mechanism, test data injections etc. is Framework to pillar automation testing.15. What are Junit annotations?
Following are the Junit Annotations: @Test: @Test is a test method which can be multiple test methods in a single test script. @Before: @Before lets the system method shall be executed every time before each of the test method. @After: @After lets method shall be executed every time after each of the test method. @BeforeClass: @BeforeClass method shall be executed once before any of the test method. @AfterClass: @AfterClass method shall be executed once after any of the test method. @Ignore: @Ignore method shall not be executed.
16. What is TestNG and how is it better than Junit?
An advance framework designed in a way to leverage the benefits by both the developers and testers is TestNG. With the initiation of the frameworks, JUnit gained a vast popularity across the Java applications, Java developers and Java testers with remarkably multiply the code quality. Despite being easy to use and straightforward, JUnit has its own restraint which give rise to the need of bringing TestNG into the picture. TestNG is an open source framework which is allotted under the Apache software License and is promptly available for download.TestNG with WebDriver present an efficient and effective test result format that can in turn be shared with the stakeholders to have a glance on the product’s or application’s health thereby terminate the disadvantages of WebDriver’s incapability to initiate the test reports. TestNG has an inbuilt exception grasp the mechanism which lets the program to run without terminating unexpectedly.
The advantages that make TestNG superior to JUnit are: