Agile Automation

Agile AutomationAgile AutomationAgile Automation
Home
About
Contact
Learn More
  • UI Testing

Agile Automation

Agile AutomationAgile AutomationAgile Automation
Home
About
Contact
Learn More
  • UI Testing
More
  • Home
  • About
  • Contact
  • Learn More
    • UI Testing
  • Home
  • About
  • Contact
  • Learn More
    • UI Testing

Automation 101

The Basics of Streamlining Your Processes

 What is Automation Testing?


 Automation testing is the process of using software tools to execute pre-scripted tests on a software application or system in order to determine whether it meets the desired requirements. In other words, it is the use of automated testing tools to perform tests that were previously performed manually.


The goal of automation testing is to increase the speed and efficiency of software testing while reducing the risk of human error. Automation testing can be used for a wide range of software applications, from desktop applications to web applications and mobile applications.


Automation testing can be used for functional testing, performance testing, security testing, and other types of software testing. It typically involves creating test scripts or test cases that automate the testing process and provide feedback on the performance and behavior of the software application or system being tested. The test scripts are typically run on a regular basis to ensure that the software remains functional and free from defects.


When do we go for Automation?  


 Automation testing is generally used when there is a need to test a software application repeatedly or when there is a need to test the same functionality with different sets of data. It is also used when there is a need to test the application quickly, accurately, and efficiently.


Some common situations where automation testing may be preferred include:


  1. Regression testing: When there are frequent code changes or updates to an application, regression testing is required to ensure that the new changes have not introduced any unintended defects or broken any existing functionality. Automation testing is often preferred for regression testing as it can save time and reduce the risk of errors.
  2. Repetitive testing: When there is a need to run the same tests repeatedly, automation testing is a good option as it can save time and reduce the risk of errors.
  3. Large-scale testing: When testing needs to be done on a large scale or across multiple platforms, automation testing is preferred as it can save time and reduce the need for manual testing.
  4. Performance testing: When testing needs to be done to evaluate the performance of an application under different conditions, automation testing is preferred as it can simulate different scenarios and provide accurate and consistent results.


In general, automation testing is preferred when there is a need for repetitive, consistent, and reliable testing of software applications. However, it is important to note that not all types of testing can be automated, and manual testing may still be required in certain situations.


What is an Automation Script? 


 An automation script is a set of instructions or code that is used to automate the testing of a software application. It is a program that performs a specific set of tasks, such as navigating through an application, entering data, and verifying the output.


Automation scripts can be created using a variety of programming languages, such as Java, Python, or Ruby. The script is typically written to interact with the application under test, simulate user actions, and check for the expected output.


The process of creating an automation script typically involves identifying the test cases that need to be automated, designing the script to perform those test cases, and then implementing and testing the script to ensure that it is accurate and reliable.


Automation scripts can be run on a regular basis to perform automated testing and provide feedback on the performance and behavior of the software application or system being tested. The results of the automated tests can be used to identify and fix defects or to verify that new features and functionality have been implemented correctly.


Overall, automation scripts can help to increase the speed, efficiency, and accuracy of software testing while reducing the risk of human error.


What is an Automation Tool? 


 An automation tool is a software application or program that is used to automate the process of testing software applications. It is designed to assist in the creation, execution, and analysis of automated tests.


Automation tools can be used to automate a wide range of testing activities, such as functional testing, performance testing, security testing, and more. These tools typically provide a graphical user interface (GUI) that allows testers to create and execute tests without the need for programming skills.


Automation tools can also provide features such as record and playback, where a tester can record their interactions with the application and then play them back in an automated test script. Other features of automation tools may include the ability to create data-driven tests, where different sets of data can be used to execute the same test, and the ability to generate reports and metrics on the results of the tests.


Examples of popular automation tools include Selenium, Appium, JMeter, LoadRunner, and SoapUI.


Overall, automation tools can help to reduce the time and effort required for software testing, increase the accuracy and reliability of tests, and provide insights into the performance and behavior of the software application or system being tested.


What are the advantages of Automation Testing? 


 There are several advantages of automation testing, including:


  1. Faster Testing: Automation testing can execute test cases faster than manual testing, allowing for quicker feedback and faster delivery of software products.
  2. Improved Accuracy: Automation testing eliminates the possibility of human errors that can occur during manual testing, resulting in more accurate test results.
  3. Increased Test Coverage: Automation testing can execute a large number of test cases simultaneously, making it possible to cover more test scenarios than is possible with manual testing.
  4. Reusability of Tests: Automation testing scripts can be reused for regression testing, making it easier to test the software application after making changes or updates.
  5. Consistency: Automation testing ensures that the same tests are executed every time, ensuring consistent results and reducing the likelihood of errors.
  6. Cost Savings: Automation testing can save costs by reducing the need for manual testing, reducing the time and effort required for testing, and improving the overall quality of the software application.
  7. Continuous Testing: Automation testing can be integrated with continuous integration and continuous delivery (CI/CD) processes to provide continuous testing and feedback on the software application.


Overall, automation testing can significantly improve the speed, accuracy, and efficiency of software testing, resulting in better-quality software products and a more efficient development process.


What are the disadvantages of Automation Testing?


While automation testing offers many advantages, there are also some potential disadvantages to consider:


  1. Initial Setup: The initial setup for automation testing can be time-consuming and require significant effort to design and develop the automation scripts.
  2. Maintenance: Automation testing scripts require maintenance and updates as the software application evolves, which can be time-consuming and require ongoing effort.
  3. Cost: The cost of implementing automation testing can be higher than manual testing, as it may require specialized skills and tools.
  4. Limited Testing Scope: Not all testing scenarios can be automated, and some types of testing, such as exploratory testing, are better suited to manual testing.
  5. False Positives: Automation testing can produce false positive results if the automation script is not designed correctly or if there are issues with the test environment.
  6. Lack of Human Judgment: Automation testing lacks human judgment and intuition, which can be valuable in identifying defects or unexpected behavior.
  7. Dependency on Tools: Automation testing is dependent on the quality and reliability of the automation testing tools, which can be a risk if the tools are not maintained or updated regularly.


Overall, it is important to weigh the advantages and disadvantages of automation testing when deciding whether to implement it as part of a software testing strategy.


What are the different Automation tools available in the market? 


 There are many different automation tools available in the market, each with its own strengths and weaknesses. Some of the most popular automation tools include:


  1. Selenium: Selenium is an open-source automation testing tool that is widely used for web application testing. It supports multiple programming languages and offers a range of features such as record and playback, data-driven testing, and test suite management.
  2. Appium: Appium is an open-source automation testing tool that is used for testing mobile applications. It supports both iOS and Android platforms and offers a range of features such as record and playback, real device testing, and parallel testing.
  3. JMeter: JMeter is an open-source automation testing tool that is used for performance testing. It can simulate heavy loads and stress testing for web applications, FTP servers, databases, and more.
  4. TestComplete: TestComplete is a commercial automation testing tool that offers a range of features such as record and playback, scriptless testing, and cross-browser testing. It supports a range of programming languages and platforms, including web, desktop, and mobile applications.
  5. Katalon Studio: Katalon Studio is a free automation testing tool that is used for web and mobile applications. It offers a range of features such as record and playback, object repository, and test suite management.
  6. HP UFT: HP UFT (Unified Functional Testing) is a commercial automation testing tool that offers a range of features such as record and playback, keyword-driven testing, and test data management. It supports web, desktop, and mobile applications.
  7. SoapUI: SoapUI is an open-source automation testing tool that is used for testing web services. It supports both REST and SOAP protocols and offers a range of features such as automated functional testing, load testing, and security testing.


Overall, the choice of automation testing tool will depend on the specific requirements of the software application being tested, as well as the budget and technical skills of the testing team.

Selenium as an Automation Tool

Continue Your Learning Journey with These Related Topics
Introduction to webdriver interfaceIntroduction to HTMLIntroduction to LocatorsIntroduction to SearchContext InterfaceIntroduction to WebElement InterfaceIntroduction To Actions ClassHow To handle dropdownsHow to handle FramesHow to handle PopupsHow to Take ScreenShotsIntroduction to JavaScriptExecutorData-Driven TestingPOM ClassesInterview Questions

Introduction to Selenium Webdriver

Selenium: Revolutionizing Test Automation

 Selenium stands tall as an open-source test automation tool, wielding its prowess to test both web and mobile applications. Here's a closer look at what makes Selenium the go-to choice for testers and developers alike: 

Understanding Selenium:

  • Open Source:
    Selenium emerges as a champion of freedom, offering not only a powerful testing solution but also the liberty to modify it as per your needs.
  • Test Automation Tool:
    Selenium is the quintessential example of a test automation tool, a software designed to test other software seamlessly.
  • Web Application:
    These applications thrive on the internet, accessed through web browsers, making them easily accessible and versatile.
  • Mobile Application:
    Tailored for smartphones and tablet computers, mobile applications bring convenience to the palm of your hand.


Key Notes:

  • Selenium WebDriver for Web Application Testing:
    For testing web applications, Selenium WebDriver reigns supreme.
  • Appium for Mobile Application Testing:
    To test mobile applications, look no further than Appium.
  • Selenium: The Headless Wonder:
    Selenium operates without a user interface, making it a headless tool, perfect for seamless automation.

Advantages of Selenium:

  1. Open Source Freedom:
    Enjoy the liberty of an open-source tool, allowing for unrestricted usage and modification, fostering innovation and collaboration.
  2. Multi-Language Support:
    Selenium opens its arms to developers of various programming languages, offering flexibility and ease of integration.
  3. Cross-Platform Compatibility:
    With support for multiple operating systems and browsers, Selenium ensures smooth testing across different environments.
  4. Browser Diversity:
    Selenium's compatibility with numerous browsers, including headless options, enables comprehensive browser compatibility testing.

Disadvantages of Selenium WebDriver:

While Selenium excels in web and mobile application testing, it falls short when it comes to automating standalone applications.  

Flavors of Selenium:

 1. Selenium Core (2004):The inception of Selenium, supporting only Java programming language. Lacked IDE support, requiring scripts to be executed via command prompt.


2. Selenium RC (Remote Control) (2006):Evolving from Selenium Core, introduced in 2006.Expanded language support to include Java, Ruby, Python, etc. Encountered proxy server issues during usage.


3. Selenium IDE:A record and playback tool simplifying test automation. Limited browser support, catering primarily to Chrome and Firefox users. Debugging code within Selenium IDE posed challenges.


4. Selenium WebDriver (2007):Released in 2007, Selenium WebDriver emerged as a game-changer. Extensive language and browser support, facilitating seamless automation. Streamlined debugging process and enhanced functionality.


5. Selenium Grid: Dedicated to executing tests on remote machines, Selenium Grid ensures scalability and efficiency.


6. Appium: Tailored specifically for mobile application testing, Appium delivers robust solutions for mobile automation needs.


As Selenium continues to evolve, these distinct flavors cater to varied requirements, ensuring a comprehensive suite of tools for efficient test automation across different platforms and technologies. 

Selenium WebDriver Architecture

Selenium WebDriver operates on a robust architecture comprising four integral components:


1. Selenium Client Bindings/Language Bindings:

  • These are libraries furnished by Selenium developers, tailored to various programming languages supported by Selenium.
  • For instance, the Java client binding is encapsulated within the selenium-server-standalone.jar file.
  • Also referred to as language bindings or client libraries.


2. JSON Wire Protocol:

  • Facilitates communication between the client (automation script) and the server.
  • Automation scripts are transformed into a standardized protocol known as JSON Wire Protocol, comprehensible by the driver executable software.
  • JSON, or Java Script Object Notation, serves as the basis for this protocol, offering a lightweight data exchange format.
  • Historically, XML was prevalent for data exchange before JSON emerged as a more lightweight alternative.
  • JSON structures data in key-value pairs, employing JavaScript object creation syntax.


3. Driver Executable Software:

  • These are tools provided by browser developers to enable automation within their respective browsers.
  • Each driver executable software encompasses two primary components: i. Server: Receives requests from the client (automation script) in JSON wire protocol format, processes them, and executes the requested actions on the Application Under Test (AUT) within the browser. ii. Browser Native APIs: Browser-specific functionalities designed to facilitate automation within the browser environment.


Understanding the Selenium WebDriver architecture unveils the intricate interplay between these components, culminating in seamless test automation across diverse browsers and platforms.


Configuring Selenium WebDriver in Eclipse IDE


To seamlessly integrate Selenium WebDriver into Eclipse IDE, follow these steps:


1. System Requirements:

   - Ensure JDK 1.8 or above is installed on your system.

   - Eclipse Photon or a later version (2020 or 2021) should be installed.


2. Project Setup:

   - Create a new Java project in Eclipse.

   - Organize your project by creating a package.


3. Creating "Hello World" Program:

   - Craft a simple "Hello World" program to verify your setup.

   - Execute the program to ensure everything functions correctly.


4. Setting Up Project Structure:

   - Establish two folders within your project:

     - `Drivers`: Store driver executable software here.

     - `Jars`: House all `.jar` files related to the project.


5. Managing Driver Executables and Jar Files:

   - Copy and paste the driver executable software and Selenium `.jar` files into their respective folders (`Drivers` and `Jars`).


6. Adding Selenium Jar to Build Path:

   - Right-click on the `selenium.jar` file within Eclipse.

   - Navigate to "Build Path" and select "Add to Build Path."


Downloading Java Client Bindings:


1. Visit www.selenium.dev

2. Click on the download link.

3. Opt for the latest stable version.


Downloading Driver Executable Software (Google Chrome):


1. Determine your browser version.

2. Visit https://www.selenium.dev/downloads/

3. Scroll down to the browser section and expand it.

4. Click on the documentation link under Chrome.

5. Choose the latest stable version.

6. Download `chromedriver.win32.zip`.

7. Extract the contents and locate `chromedriver.exe`.


Driver Executable Software:

To initiate an empty web browser using Selenium WebDriver, adhere to these steps:


1. Setting Driver Executable Path:

   - Utilize browser-specific keys along with the driver executable path using the `setProperty()` method.

   - Ensure the correctness of keys (case-sensitive) and use relative paths for portability.

   - Example: `System.setProperty("webdriver.chrome.driver", "./drivers/chromedriver.exe");`


2. Creating Browser Object:

   - Import the relevant browser-related concrete class from Selenium's built-in packages.

   - Instantiate the browser class using its constructor.

   - Example: `ChromeDriver chromeDriver = new ChromeDriver();`


By following these meticulous steps, you'll seamlessly configure Selenium WebDriver within Eclipse IDE, unlocking a world of efficient test automation capabilities.

WebDriver Overview

 WebDriver is the core interface of Selenium WebDriver, essential for controlling web browsers. It provides essential methods for interacting with web pages and performing automation tasks. 

Main Methods:

 1. get()

  • Navigates to the main URL of the Application under Test (AUT).
  • Takes a fully qualified URL as input.
  • Waits for the entire page to load.
  • Throws an InvalidArgumentException if the protocol is not mentioned.


Implementation:


public void get(String URL) {

    // Implementation

}


Usage: 


driver.get("https://www.google.com/");


 

2. getCurrentUrl()

  • Retrieves the URL of the current webpage.
  • Returns the URL as a string.


Implementation:


public String getCurrentUrl() {

    // Implementation

}


Usage: 


String actualUrl = driver.getCurrentUrl();


3. getTitle()

  • Retrieves the title of the current webpage.
  • Returns the title as a string.


Implementation:


public String getTitle() {

    // Implementation

}


Usage: 


String actualTitle = driver.getTitle();


 

4. getPageSource()

  • Retrieves the source code of the current web page.
  • Returns the source code as a string.


Implementation:


public String getPageSource() {

    // Implementation

}


Usage:


String source = driver.getPageSource();


 

5. close()

  • Closes the current browser window.
  • Returns void.


Implementation:


public void close() {

    // Implementation

}


Usage:


driver.close();


6. quit()

  • Closes all browser windows and stops the server.
  • Returns void.


Implementation:


public void quit() {

    // Implementation

}


Usage:


driver.quit();


Navigation Methods:

 1. navigate()

  • Performs browser history navigation and refreshes the webpage.
  • Returns a Navigation object.


Implementation:


public Navigation navigate() {

    // Implementation

}


Usage:


Navigation nav = driver.navigate();

nav.back();

nav.forward();

nav.refresh();

nav.to("URL");

Window Management:

 1.  manage()

  • Used for window, script timeout, and cookie-related operations.
  • Returns an Options interface object.


Implementation:


public Options manage() {

    // Implementation

}


Usage:


// Accessing the window management capabilities of the WebDriver instance

Window wind = driver.manage().window();


// Maximizing the browser window

wind.maximize();


// Entering fullscreen mode

wind.fullscreen();


// Retrieving the current dimensions of the browser window

Dimension currentDim = wind.getSize();

int width = currentDim.getWidth();

int height = currentDim.getHeight();


// Retrieving the current position of the browser window

Point currentPosition = wind.getSize();

int startX = currentPosition.getX();

int startY = currentPosition.getY();


// Resizing the browser window to a specific dimension

wind.setSize(new Dimension(500, 600));


// Moving the browser window to a specific position

wind.setPosition(new Point(200, 70));

Other Methods:

 1. switchTo()

  • Transfers the driver control to target areas like browser windows, frames, alerts, etc.
  • Returns a TargetLocator interface object.


2. getWindowHandle()

  • Retrieves the current window ID.
  • Returns the window ID as a string.


3. getWindowHandles()

  • Retrieves all window IDs.
  • Returns a set of window IDs as strings.

HTML

What is HTML?


HTML stands for Hyper Text Mark-up Language. It's the language used to structure content on the web. Think of it as the skeleton that gives structure to web pages.


Key Points About HTML:

  • Display: HTML helps display content on web browsers in an organized way.
  • Nested Language: HTML is structured like a tree, with elements nested within each other.
  • Case Insensitivity: HTML tags are not case-sensitive, meaning you can use uppercase or lowercase letters.
  • File Extension: HTML files have a .html extension, for example, FileName.html.
  • Tags: In HTML, everything is wrapped in tags, which are enclosed in angle brackets (< >).


Main Tags in HTML:

  • <html>: This is the root tag of every HTML document and contains all other tags.
    • <head>: This tag holds metadata about the document, such as the title and links to stylesheets.
    • <body>: This tag contains the main content of the document, such as text, images, and links.


Frequently Asked Questions (FAQs):


1. What is a tag?

A tag is like a label that defines different parts of a web page. It's enclosed in angle brackets (< >).


2. What is a tagName?

The tagName is the first word within a tag. It identifies the type of element.


3. What is an attribute?
An attribute provides additional information about an HTML element. It's written as key-value pairs inside the opening tag.


4. What is an Attribute name?
The attribute name is the key part of an attribute pair. It identifies the attribute being used.


5. What is an Attribute value?
The attribute value is the information assigned to the attribute. It follows the attribute name and is enclosed in quotes.


6. What is text?
Text refers to any content placed between the opening and closing tags of an element.


7. What is link text?
Link text is the clickable text displayed within an anchor (<a>) tag.


Sample HTML Code:


<html> <!-- Opening tag for the HTML document -->


     <head> <!-- Head section containing metadata and resources -->

              <title> Selenium Demo </title> <!-- Title of the document -->

      </head>


      <body> <!-- Body section containing the main content -->


              <h1> Demo Page For HTML </h1> <!-- Heading level 1 -->


             <!-- Username input field -->

             <span>Username</span> <!-- Text label for username -->

             <input type="text" id="123" name="abhishek"> <!-- Input field for username -->

             <br> <!-- Line break -->


             <!-- Password input field -->

             <span>Password</span> <!-- Text label for password -->

             <input type="text" id="345" name="arun"> <!-- Input field for password -->

             <br> <!-- Line break -->


            <!-- Remember Me checkbox -->

            <input type="checkbox"> <!-- Checkbox input -->

            <span> Remember Me </span> <!-- Text label for remember me -->


            <br> <!-- Line break -->


           <!-- Radio buttons for gender selection -->

          <input type="radio"> <!-- Radio button for male -->

          <span> Male </span> <!-- Text label for male -->

          <input type="radio"> <!-- Radio button for female -->

          <span> Female </span> <!-- Text label for female -->

          <input type="radio"> <!-- Radio button for others -->

          <span> Others </span> <!-- Text label for others -->


          <br> <!-- Line break -->


         <!-- Login button -->

         <button type="submit">Login</button> <!-- Submit button for login -->


         <!-- Link to Google website -->

         <a href="https://www.google.com/"> Goto Qspiders </a> <!-- Anchor link -->


     </body>


</html> <!-- Closing tag for the HTML document -->


Copyright © 2023 agileautomation - All Rights Reserved.

Contact me to get your own website.

This website uses cookies.

We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.

Accept