Framework Flashcards

1
Q

What is a framework?

A

A framework defines a set of rules or best practices that we can follow in a systematic way to achieve the desired results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Types of Test Automation Framework

A
  1. Linear Scripting Framework
  2. Modular Testing Framework
  3. Library Architecture Testing Framework
  4. Data-driven Testing Framework
  5. Keyword Driven Testing Framework
  6. Hybrid Testing Framework
  7. Behavior Driven Development Testing Framework
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Linear Scripting Framework

A
  1. Basic level test automation framework that is in the form of ‘Record and Playback’ in a linear fashion.
  2. This type of framework is used to test small-sized applications.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Advantages of Linear Scripting Automation Framework

A
  1. Can generate test scripts (Record and playback) without planning much or consume much time
  2. Coding knowledge is not required
  3. A quick way to generate test scripts

OR

  1. Flexible
  2. Simple
  3. Fast
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Disadvantages of Linear Scripting Automation Framework

A
  1. Lack of reusability due to autogenerated scripts
  2. Hard coding the data doesn’t allow us to run with multiple data sets
  3. Maintenance is —high – It requires a lot of effort to do even small changes.

OR

  1. Single-use
  2. High Maintenance
  3. Redundant
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Modular Testing Framework

A
  1. Testers create test scripts module wise by breaking down the complete application under test into smaller, independent tests.
  2. In simple words, testers divide the application into multiple modules and create test scripts individually.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Advantages of Modular Testing Framework

A
  1. Better scalability and easier to maintain due to breaking down the complete application into different modules
  2. Can write test scripts independently
  3. Changes in one module bring no or low impact on the other modules

OR

  1. Reusable
  2. Modular approach
  3. Efficient
  4. Scalable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Disadvantages of Modular Testing Framework

A
  1. Takes more time to analyze the test cases and to identify reusable flows
  2. Due to hardcoded data in the test scripts, it’s not possible to sue multiple data sets.
  3. Requires coding skills to set up the framework

OR

  1. Less flexible
  2. Requires technical knowledge
  3. Complex
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Library Architecture Framework

A
  1. This framework is derived from the modular framework that aims to provide a greater level of modularity to testing by breaking down tests by units, functions, etc.
  2. The library architecture framework identifies similar tasks within test scripts and groups them by function. These modular parts aren’t directly about function—they’re more focused on common objectives. Then these functions are stored in a library sorted by their objectives, and test scripts call upon this library to obtain different functionality when testing.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Advantages of Library Architecture Framework

A
  1. A high level of modularity leads to increased scalability of test cases
  2. Increased reusability as libraries can be used across different test scripts
  3. Can be a cost-effective solution due to its reusability, especially in larger projects

OR

  1. High reusability
  2. Cost-effective
  3. Scalable
  4. High long time ROI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Disadvantages of Library Architecture Framework

A
  1. Can be complex to set up and integrate into delivery pipelines
  2. Technical expertise is required to identify and modularize the common tasks
  3. Test data are static as they are hardcoded in script with any changes requiring direct changes to the scripts

OR

  1. More development time
  2. High technical knowledge required
  3. Complicated
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Data-Driven Framework

A
    1. The data-driven test automation framework is focused on separating the test scripts logic and the test data from each other.
      1. It allows us to create test automation scripts by passing different sets of test data.
      2. The test data set is kept in the external files or resources such as MS Excel Sheets, MS Access Tables, SQL Database, XML files, etc.,
      3. The test scripts connect to the external resources to get the test data.
      4. By using this framework we could easily make the test scripts work properly for different sets of test data.
      5. This framework significantly reduces the number of test scripts compared to the module-based framework.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Advantages of a Data-Driven Framework

A
  1. It supports multiple data sets
  2. Modifying the test scripts won’t affect the test data
  3. No need to hardcode test data
  4. Saves time by executing more tests

OR

  1. Scalable
  2. Faster testing
  3. Fewer scripts required
  4. Flexible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Disadvantages of a Data-Driven Framework

A
  1. Require coding skills
  2. Setting up the framework and test data takes more time
  3. Need experienced automation testers to design framework

OR

  1. High setup time
  2. Excellent technical knowledge required
  3. Troubleshooting is difficult
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Keyword Driven Testing Framework

A
  1. It is also known as table-driven testing or action word based testing.
  2. In Keyword-driven testing, we use a table format to define keywords or action words for each function or method that we would execute.
  3. It performs automation test scripts based on the keywords specified in the excel sheet.
  4. By using this Framework, testers can work with keywords to develop any test automation script, testers with less programming knowledge would also be able to work on the test scripts.
  5. The logic to read keywords and call the required action mentioned in the external excel sheet is placed in the main class. Keyword-driven testing is similar to data-driven testing.
  6. Even though to work on this framework doesn’t require much programming skills but the initial setup ( implement the framework) requires more expertise.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Advantages of Keyword-Driven Framework

A
  1. No need to be an expert to write test scripts
  2. It is possible to reuse the code. We can point the different scripts to the same keyword
  3. Even though application changes, test scripts don’t change
  4. Tests can be designed before developing the application
  5. Test scripts work independently of an application under test with basic modifications
  6. Not dependent on test tools

OR

  1. Reusable
  2. Scalable
  3. Less Maintenance
17
Q

Disadvantages of Keyword-Driven Frameworks

A
  1. Take more time to design
  2. The initial cost is high
  3. Employees with good test automation skills needed

OR

  1. High development time
  2. Complexity increase over time
  3. High automation knowledge required
18
Q

Hybrid Driven Testing Framework

A

Hybrid Test automation framework is the combination of two or more frameworks mentioned above. It attempts to leverage the strengths and benefits of other frameworks for the particular test environment it manages. Most of the teams are building this hybrid driven framework in the current market.

19
Q

Behavior Driven Development Testing Framework

A

The purpose of this Behavior Driven Development framework is to create a platform that allows everyone (such as Business Analysts, Developers, Testers, etc,) to participate actively. It requires increased collaboration between Development and Test Teams. It doesn’t require the users to be acquainted with a programming language. We use non-technical, natural language to create test specifications. Some of the tools available in the market for Behavior Driven Development is JBehave, Cucumber, etc.,

20
Q

Why Do We Need a Test Automation Framework?

A
  1. Optimization of Resources
    It does this by facilitating the use of different resources according to organizational needs.
  2. Increased Volume of Testing
    Test automation frameworks increase the volume of testing.
  3. Simultaneous Testing
    Enable simultaneous testing of different types of devices. When the test scripts are automated, all testers need to do is run them on different devices. Since the parameters are same, testers can quickly generate comparative test reports.
  4. Enhanced Speed and Reliability
    Reduce the time to carry out these activities. You can simultaneously run all the scenarios and get the test results in very little time.
  5. More Output in Less Time
    An automation script minimizes the time taken to prepare and run tests. With increased efficiency and speed, a firm can gain more output in less time.
  6. Fixing Bugs at an Early Stage
    Helps in fixing bugs at an early stage.
  7. Remote Testing
    You can start running a test before leaving. When you come back after a few hours, the test results will be ready.
  8. Reusable Automation Code
    You can reuse test automation scripts in a different application.
  9. Increased ROI
    The initial investment involved in test automation frameworks is off-putting for many. But the long-term return on investment is high.
  10. Continuous Testing
    The importance of continuous integration and continuous delivery/deployment can’t be overstated.
21
Q

How to build a test automation framework?

A
  1. first learn what the application does
  2. pick framework
    — data driven
  3. pick tools to use
    — selenimum
    — java (a lot of java automation testers)
    — TestNG annotations: used for assertions, grouping and parallel execution
    *****Integrating the TestNG dependency in the POM.xml file and running this POM.xml file using Jenkin
    — Git (verizon contol): use a repository to store test scripts
    — Maven: used for build execution and dependency purpose
    ***** create Maven project
  4. Create Test Base Class (src/test/java/tests)
    — contains all the common functions used by all the pages
    — responsible for loading the configurations from property files (see bullet 5)
    — opening/closing browser
    — initialize implicit wait
    — setup webdriver
    — setup reports
    — create object of file input stream points to file which data should be read
  5. Property files (config.properties src/main/java/config/)
    — contains information that remains static throughout
    — URL, browsers, screenshots path
    — could contain browser type, URL
    — testing annotations should go here
  6. Page object model with page factory page
    — use to keep locators (i.e. id, path) from test code
    — design pattern with page factory page object model
    — each web page has a separate class (src/main/java/page)
    — class holds the functionality and members of the
    — each individual test has a separate class (src/test/java/tests)
    — separate packages for pages and test script
  7. Execute maven project using jenkins (look at webpage)
    — integrating the testing dependency in the pom.xml file and run the pom.xml using Jenkins
    Continuous Integration Tools)
    — execute on a daily basis and at nightly by schedule
    — Test Results will be sent to the peers using Jenkins
  8. Test data held in excel under (src/main/java/testdata)
    — Apache POI to handle excel sheet
    — Parameterize tests using Excel files
  9. Utility class (src/main/java/util/TestUtil.java)
    — Stores and handles the functions (The code which is repetitive in nature such as waits, actions, capturing screenshots, accessing excels, sending email, etc.)
    — Functions can be commonly used across the framework.
    — Created to achieve reusability.
    — Extends the TestBase class to inherit the properties of TestBase in TestUtil.
  10. Error screenshot and logs
    — screenshots separate folder (src/test/java/FailedTestsScreenshots)
    — screenshots of failed test cases will be added to extend reports
  11. Extent reports (src/test/java/test-output)
    — An open-source reporting library used in selenium
22
Q

Where you have applied OOPS in Automation Framework

ABSTRACTION

A

#1. ABSTRACTION
Abstraction is the methodology of hiding the implementation of internal details and showing the functionality to the users.

In Page Object Model design pattern, we write locators (such as id, name, xpath etc.,) and the methods in a Page Class. We utilize these locators in tests but we can’t see the implementation of the methods. Literally we hide the implementations of the locators from the tests.

23
Q

Where you have applied OOPS in Automation Framework

INTERFACE

A

#2. INTERFACE
Basic statement we all know in Selenium is WebDriver driver = new FirefoxDriver();

Detailed explanation on why we write WebDriver driver = new FirefoxDriver(); in Selenium.

WebDriver itself is an Interface. So based on the above statement WebDriver driver = new FirefoxDriver(); we are initializing Firefox browser using Selenium WebDriver. It means we are creating a reference variable (driver) of the interface (WebDriver) and creating an Object. Here WebDriver is an Interface as mentioned earlier and FirefoxDriver is a class.

An interface in Java looks similar to a class but both the interface and class are two different concepts. An interface can have methods and variables just like the class but the methods declared in interface are by default abstract. We can achieve 100% abstraction and multiple inheritance in Java with Interface.

24
Q

Where you have applied OOPS in Automation Framework

INHERITANCE

A

#3. INHERITANCE
The mechanism in Java by which one class acquires the properties (instance variables) and functionalities of another class is known as Inheritance.

We create a Base Class in the Automation Framework to initialize WebDriver interface, WebDriver waits, Property files, Excels, etc., in the Base Class.

We extend the Base Class in other classes such as Tests and Utility Class.

Here we extend one class (Base Class like WebDriver Interface) into other class (like Tests, Utility Class) is known as Inheritance.

25
Q

Where you have applied OOPS in Automation Framework

POLYMORPHISM

A

#4. POLYMORPHISM
Polymorphism allows us to perform a task in multiple ways.

Combination of overloading and overriding is known as Polymorphism. We will see both overloading and overriding below.

26
Q

Where you have applied OOPS in Automation Framework

POLYMORPHISM - METHOD OVERLOADING

A

#4a: METHOD OVERLOADING
We use Implicit wait in Selenium. Implicit wait is an example of overloading. In Implicit wait we use different time stamps such as SECONDS, MINUTES, HOURS etc.,

Action class in TestNG is also an example of overloading.

Assert class in TestNG is also an example of overloading.

A class having multiple methods with same name but different parameters is called Method Overloading

27
Q

Where you have applied OOPS in Automation Framework

POLYMORPHISM - METHOD OVERRIDING

A

#4b: METHOD OVERRIDING
We use a method which was already implemented in another class by changing its parameters. To understand this you need to understand Overriding in Java.

Declaring a method in child class which is already present in the parent class is called Method Overriding. Examples are get and navigate methods of different drivers in Selenium .

28
Q

Where you have applied OOPS in Automation Framework

ENCAPSULATION

A

#5. ENCAPSULATION
All the classes in a framework are an example of Encapsulation. In POM classes, we declare the data members using @FindBy and initialization of data members will be done using Constructor to utilize those in methods.

Encapsulation is a mechanism of binding code and data (variables) together in a single unit.