Latest Blogs || News || Events || Questions || FAQs

Selenium Interview Questions and Answers

Frequently asked Interview Questions with Answer in Selenium

1. What are the annotations used in TestNG ?

A. @Test, @BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest, @BeforeClass, @AfterClass, @BeforeMethod, @AfterMethod.

2. What are the limitations of Selenium?

A. Following are the limitations of Selenium:

  • Selenium supports testing of only web based applications
  • Mobile applications cannot be tested using Selenium
  • Captcha and Bar code readers cannot be tested using Selenium
  • Reports can only be generated using third party tools like TestNG or Junit.
  • As Selenium is a free tool, thus there is no ready vendor support though the user can find numerous helping communities.
  • User is expected to possess prior programming language knowledge.

3. What is Selenium? What are the different Selenium components?

A. Selenium is one of the most popular automated testing suites. Selenium is designed in a way to support and encourage automation testing of functional aspects of web based applications and a wide range of browsers and platforms. Due to its existence in the open source community, it has become one of the most accepted tools amongst the testing professionals.

Selenium is not just a single tool or a utility, rather a package of several testing tools and for the same reason it is referred to as a Suite. Each of these tools is designed to cater different testing and test environment requirements.

The suite package constitutes of the following sets of tools:

  • Selenium Integrated Development Environment SIDE– Selenium IDE is a record and playback tool. It is distributed as a Firefox Plugin.
  • Selenium Remote Control (RC) – Selenium RC is a server that allows user to create test scripts in a desired programming language. It also allows executing test scripts within the large spectrum of browsers.
  • Selenium WebDriver – WebDriver is a different tool altogether that has various advantages over Selenium RC. WebDriver directly communicates with the web browser and uses its native compatibility to automate.
  • Selenium Grid –  Selenium Grid is used to distribute your test execution on multiple platforms and environments concurrently

4. What is Selenese?

A. Selenese is the language which is used to write test scripts in Selenium IDE.

5. What is the use of xpath ?

A. It is used to find the WebElement in web page. It is very useful to identify the dynamic web elements.

6. What is the difference between Assert and Verify?

A. Assert- it is used to verify the result. If the test case fail then it will stop the execution of the test case there itself and move the control to other test case.

Verify- it is also used to verify the result. If the test case fail then it will not stop the execution of that test case.

7. How do you handle alert pop-up ?

A. To handle alert pop-ups, we need to 1st switch control to alert pop-ups then click on ok or cancle then move control back to main page.

String mainPage = driver.getWindowHandle();

Alert alt = driver.switchTo().alert(); // to move control to alert popup

 alt.accept(); // to click on ok.

 alt.dismiss(); // to click on cancel.

 //Then move the control back to main web page-

 driver.switchTo().window(mainPage); → to switch back to main page.

8. What is the difference between “/” and “//” in Xpath?

A. Single Slash “/” – Single slash is used to create Xpath with absolute path i.e. the xpath would be created to start selection from the document node/start node.

Double Slash “//” – Double slash is used to create Xpath with relative path i.e. the xpath would be created to start selection from anywhere within the document.

9. What do we mean by Selenium 1 and Selenium 2?

A. Selenium RC and WebDriver, in a combination are popularly known as Selenium 2. Selenium RC alone is also referred as Selenium 1.

10. How do I launch the browser using WebDriver?

A. The following syntax can be used to launch Browser:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
WebDriver driver = new InternetExplorerDriver();

11. What are the different types of waits available in WebDriver?

A. There are two types of waits available in WebDriver:

  1. Implicit Wait
  2. Explicit Wait

Implicit Wait: Implicit waits are used to provide a default waiting time (say 30 seconds) between each consecutive test step/command across the entire test script. Thus, subsequent test step would only execute when the 30 seconds have elapsed after executing the previous test step/command.

Explicit Wait: Explicit waits are used to halt the execution till the time a particular condition is met or the maximum time has elapsed. Unlike Implicit waits, explicit waits are applied for a particular instance only.

12. What are the different types of navigation commands?

A. Following are the navigation commands:
navigate().back() – The above command requires no parameters and takes back the user to the previous webpage in the web browser’s history.

navigate().forward() – This command lets the user to navigate to the next web page with reference to the browser’s history.

navigate().refresh() – This command lets the user to refresh the current web page there by reloading all the web elements.

13. When do we use findElement() and findElements()?

A. findElement(): findElement() is used to find the first element in the current web page matching to the specified locator value. Take a note that only first matching element would be fetched.


WebElement element = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));
findElements(): findElements() is used to find all the elements in the current web page matching to the specified locator value. Take a note that all the matching elements would be fetched and stored in the list of WebElements.

List <WebElement> elementList = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));

14. How do I submit a form using Selenium?
A. driver.findElement(“ElementID”)). submit();

15. What is the difference between driver.close() and driver.quit() command?

A. close(): WebDriver’s close() method closes the web browser window that the user is currently working on or we can also say the window that is being currently accessed by the WebDriver. The command neither requires any parameter nor does is return any value.

quit(): Unlike close() method, quit() method closes down all the windows that the program has opened. Same as close() method, the command neither requires any parameter nor does is return any value.

16. What is a framework?

A. Framework is a constructive blend of various guidelines, coding standards, concepts, processes, practices, project hierarchies, modularity, reporting mechanism, test data injections etc. to pillar automation testing.

17. What are the different types of frameworks?

A. Below are the different types of frameworks:

  1. Module Based Testing Framework: The framework divides the entire “Application Under Test” into number of logical and isolated modules. For each module, we create a separate and independent test script. Thus, when these test scripts taken together builds a larger test script representing more than one module.
  2. Library Architecture Testing Framework: The basic fundamental behind the framework is to determine the common steps and group them into functions under a library and call those functions in the test scripts whenever required.
  3. Data Driven Testing Framework: Data Driven Testing Framework helps the user segregate the test script logic and the test data from each other. It lets the user store the test data into an external database. The data is conventionally stored in “Key-Value” pairs. Thus, the key can be used to access and populate the data within the test scripts.
  4. Keyword Driven Testing Framework: The Keyword driven testing framework is an extension to Data driven Testing Framework in a sense that it not only segregates the test data from the scripts, it also keeps the certain set of code belonging to the test script into an external data file.
  5. Hybrid Testing Framework: Hybrid Testing Framework is a combination of more than one above mentioned frameworks. The best thing about such a setup is that it leverages the benefits of all kinds of associated frameworks.
  6. Behavior Driven Development Framework: Behavior Driven Development framework allows automation of functional validations in easily readable and understandable format to Business Analysts, Developers, Testers, etc

18. Give the example for method overload in WebDriver.

A. frame(string), frame(int), frame(WebElement).

19. How do you upload a file?

A. To upload a file we can use sendKeys() method.

driver.findElement(By.xpath(“input field”)).sendKeys(“path of the file”);

20. How do you click on a menu item in a drop down menu?

A. If that menu has been created by using select tag then we can use the methods selectByValue() or selectByIndex() or selectByVisibleText(). These are the methods of the Select class.

If the menu has not been created by using the select tag then we can simply find the xpath of that element and click on that to select.

21. What are the different exceptions you got when working with WebDriver ?

A. ElementNotVisibleException, ElementNotSelectableException, NoAlertPresentException, NoSuchAttributeException, NoSuchWindowException, TimeoutException, WebDriverException etc.

22. What are the languages supported by WebDriver ?

A. Python, Ruby, C# and Java are all supported directly by the development team. There are also webdriver implementations for PHP and Perl.

23. What are the prerequisites to run selenium webdriver?

A. JDK, Eclipse, WebDriver(selenium standalone jar file), browser, application to be tested.

24. What is Selenium Grid ?

A. Selenium-Grid allows you to run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines, different browsers and operating systems. Essentially, Selenium-Grid support distributed test execution. It allows for running your tests in a distributed test execution environment.

25. How to check if a button is enabled on the page ?

A. Use isEnabled() method. The return type of the method is boolean. So if it return true then button is enabled else not enabled.

 driver.findElement(By.xpath(“xpath of button”)).isEnabled();

26. How to check the checkbox or radio button is selected ?

A. Use isSelected() method to identify. The return type of the method is boolean. So if it return true then button is selected else not enabled.

driver.findElement(By.xpath(“xpath of button”)).isSelected();

27. How can we get a text of a web element?

A. Get command is used to retrieve the inner text of the specified web element. The command doesn’t require any parameter but returns a string value. It is also one of the extensively used commands for verification of messages, labels, errors etc displayed on the web pages.

String Text = driver.findElement(“Text”)).getText();

28. How do u get the attribute of the web element ?

A. driver.getElement(By.tagName(“img”)).getAttribute(“src”) will give you the src attribute of this tag.

29. How to hover the mouse on an element ?

A. act.moveToElement(webelement); //webelement on which you want to move cursor

Agile Testing Interview Questions and Answers

Software Testing Interview Questions

Software Testing Interview Questions

  1. Can you explain the PDCA cycle and where testing fits in?
  2. What is the main benefit of designing tests early in the life cycle?
  3. What is the difference between white box, black box, and gray box testing?
  4. Can you explain usability testing?
  5. When is used Decision table testing?
  6. What are the categories of defects in requirement?
  7. We use the output of the requirement analysis, the requirement specification as the input for writing …?
  8. What is component testing?
  9. What are the different Methodologies in Agile Development Model?
  10. What is an equivalence partition (also known as an equivalence class)?
  11. A Type of functional Testing, which investigates the functions relating to detection of threats, such as virus from malicious outsiders?
  12. When “Regression Testing” should be performed?
  13. What is negative and positive testing?
  14. What is the purpose of a test completion criterion?
  15. What is the difference between re-testing and regression testing?
  16. What are the Experience-based testing techniques?
  17. What type of review requires formal entry and exit criteria, including metrics?
  18. Are there more defects in the design phase or in the coding phase?
  19. Should testing be done only after the build and execution phases are complete?
  20. What impact ratings have you used in your projects?
  21. When should testing be stopped?
  22. Mention the difference between Data Driven Testing and Retesting?
  23. What is the difference between UAT (User Acceptance Testing) and System testing?
  24. What is Integration testing?
  25. What is verification and validation?
  26. What is white box testing and list the types of white box testing?
  27. When is RTM (Requirement Traceability Matrix) prepared ?
  28. What is difference between Test matrix and Traceability matrix?
  29. What is “use case testing”?
  30. What is the difference between STLC (Software Testing Life Cycle) and SDLC (Software Development Life  Cycle) ?
  31. What is a test log?
  32. What’s the difference between alpha and beta testing?
  33. What is coverage and what are the different types of coverage techniques?
  34. Explain Branch Coverage and Decision Coverage.
  35. What is Mutation testing & when can it be done?
  36. What is severity and priority of bug? Give some example.
  37. What is Monkey testing?
  38. What is test driver and test stub?
  39. What is the purpose of test strategy?
  40. Explain bug life cycle?

To learn more Selenium Interview Questions and Answers and Agile Testing Interview Questions and Answers

Java & J2EE Live Project 2016 with Professional Certification

Java is the most demanding professional skill in the IT industry. With 3-4 million apps, it is the world’s No.1 development platform and the No.1 choice among professional developers.

The job wave of Java is always on high tides unaffected of booms & depressions. Want to see yourself among the Java professional crowd? We will help you achieve it. Enroll for the Java professional training program at Cengonsoft and make your job profile more resourceful with the live project certification. Only technical knowledge is not sufficient for a suitable job in the corporate sector. Exposure to live projects is a must add on to your portfolio.

At Cegonsoft, we have different specialized programs to cater the needs of individuals with different professional and/or academic backgrounds. We have though a program to suit each individual interest.

If you already have other technological skills and looking for a switch over to Java then we there is the Java & J2EE professional training 

Or, you are a working professional and no time for regular classes, go with the Online training on Java.

And if your target is to excel in your final year engineering projects, then opt for Final Year IEEE Projects on Java.

And for every Java job aspirant there is one choice that will make your Resume a preferable one that is the Java Live Project Certification Program.

Enroll now & get a chance for a free entry to the Cegonsoft Job Fair 2016 to be held in the First Week of August.

Limited seats are available now for upcoming batches. To register Email to or call 8494903866.

Get Trained in Cegonsoft and become Professionals

Be a Professionals in technology, Softskills and aptitude by joining Cegonsoft private Limited.

Cegonsoft provides a bunch which includes all the stuff required for the professional person as professional requires technology knowledge (practical and theory), behavior, language and Softskills. Cegonsoft teaches top 10 technology like JAVA/J2EE, PHP/My SQL, PYTHON, ASP.NET, Software testing, Digital marketing, Web Disigning, . with there advance database. Hurry if any query contact:

Cegonsoft private limited

at 8494903761


SDLC – Prototype Model and its Testing

SDLC – Prototype Model and its Testing

Software Development Life Cycle (SDLC) process is a type of structure or framework used in the development of any software product. There are many different lifecycle models defined. Waterfall model, spiral model, prototype model are a few such models. Selection of the model depends upon the requirement.

When to use Prototype Model:

Prototype model should be used when the desired system needs to have a lot of interaction with the end users. For example online systems, web interfaces have a very high amount of interaction with end users, are best suited for Prototype model.

Prototype Model:

In Prototype model  requirements are collected from the client in a textual format. The functional requirements of each prototype are analyzed and the prototype of the software product is developed. The prototype is just an image of required software product. Prototypes are tested and sent to the client for feedback. After feedback is received from the client, the required changes are implemented through the development phase. When the second prototype is ready, it is integrated with the first prototype, tested and then sent to the client. The development, prototyping and testing prototype are repeated until the final prototype is ready. The final prototype is sent to the client for a final feedback.

Prototype is earlier done by the developer. But, now it is done by web designer. They develop prototype of the product using simple readymade tools like CanvasFlip, Fluid UI.

Prototype Testing:

 Prototype testing means developers/testers are checking prototype to verify if all components mentioned exist or not. The difference between prototype testing and actual testing is in prototype testing we are checking if all the components existing whereas in actual testing we check if all components are working.

Advantages of Prototype model: 

  • Early determination of user requirement can result in faster and less expensive software
  • Customer gets the opportunity in the beginning itself to ask for changes in requirement. It is easy to do requirement changes in prototype than real application.

Disadvantages of Prototype model: 

  • There is delay in start of real project.
  • To improve communication there is an investment needed in building the prototype.

To learn more Enroll now & get a chance for a free entry to the Cegonsoft Job Fair 2016 to be held in the First Week of August.

Limited seats are available now for upcoming batches. To register Email to or call 8494903866.