Covid-19 Update!!    We have enabled all courses through virtual classroom facility using Skype or Zoom.    Don't stop learning.    Enjoy Learning from Home.

30% Discount Python        30% Discount Webdesign        30% Discount SEO        30% Discount Angular8        Free SQL Class        Free Agile Workshop       Free HTML Sessions        Free Python Basics

Important Selenium Testing Interview Questions and Answers

Selenium Interview Questions and Answers

1. What is Automation Testing?

  • The manual process to test the application/system under test is called Automation testing or Test Automation is a process of automating. Automation testing involves to use a separate testing tool which lets you create test scripts
  • which can be executed repeatedly and doesn’t require any manual intervention.

    2. What are the benefits of Automation Testing?

    Benefits of Automation testing are:
  • Supports execution of repeated test cases
  • Aids in testing a large test matrix
  • Enables parallel execution
  • Encourages unattended execution
  • Improves accuracy thereby reducing human-generated errors
  • Saves time and money

    3. Why should Selenium be selected as a test tool?

  • selenium is free and open source
  • It has a vast user base and helping circle.
  • Selenium have cross Browser similarity (Firefox, Chrome, Internet Explorer, Safari etc.)
  • Selenium have great platform affinity (Windows, Mac OS, and Linux etc.)
  • It supports various programming languages (Java, C#, Ruby, Python, and Perl etc.)
  • It has fresh and systematic repository developments
  • It supports distributed testing

    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:
  • Functional Testing
  • Regression Testing

    6. What are the limitations of Selenium?

    Following are the limitations of Selenium:
  • Selenium supports testing of only web-based applications
  • Mobile applications cannot be tested using Selenium
  • Captcha and Barcode readers cannot be tested using Selenium
  • Reports can only be produced 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.
  • The user is expected to possess prior programming language knowledge.

    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
  • Tag
  • Attribute
  • CSS
  • Linktext
  • PartialLink Text
  • Xpath etc

    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:
  • Added advance and easy annotations
  • performance patterns can be set
  • Concurrent implementation of test scripts
  • Test case outpost can be set

    17. What are the advantages of Automation framework?

    Advantage of Test Automation framework
  • Reusability of code
  • Maximum coverage
  • Recovery scenario
  • Low cost maintenance
  • Minimal manual intervention
  • Easy Reporting

    18. What are the different types of frameworks?

    Below are the different types of frameworks:
  • Module Based Testing Framework: The framework divides the entire “Application under Test” into number of logical and secluded modules. For each module, we create a different and individualistic test script. When these test scripts taken together builds a larger test script representing more than one module.
  • Library Architecture Testing Framework: The basic structure behind the framework is to direct the common steps and group them into functions under a library and call those functions in the test scripts whenever required.
  • Data Driven Testing Framework: Data Driven Testing Framework helps the user to detach 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 commonly stored in “Key-Value” pairs. Thus, the key can be used to access and populate the data within the test scripts.<
  • 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.
  • Hybrid Testing Framework: Hybrid Testing Framework is a collaboration of more than one above mentioned frameworks. The best thing about such a setup is that it influence the benefits of all kinds of associated frameworks.
  • Behaviour Driven Development Framework: Behaviour Driven Development framework allows automation of functional validations in easily readable and intelligible format to Business Analysts, Developers, Testers, etc.

    19. Can WebDriver test Mobile applications? Why?

    No, WebDriver cannot test Mobile applications. WebDriver is a web based testing tool. Therefore applications on the mobile browsers cannot be tested.

    20. Can captcha be automated?

    No, captcha cannot be automated.