Select Page

Category Selected: Automation Testing

162 results Found


People also read

Artificial Intelligence

ANN vs CNN vs RNN: Understanding the Difference

Automation Testing

No Code Test Automation Tools: Latest

Accessibility Testing

Cypress Accessibility Testing: Tips for Success

Talk to our Experts

Amazing clients who
trust us


poloatto
ABB
polaris
ooredo
stryker
mobility
Everything you need to know about Test Automation and Microservices

Everything you need to know about Test Automation and Microservices

Microservices are important to the companies who want to build and deploy systems that are scalable, flexible, adaptable, and easy to develop. Automation tests are therefore needed to take things to live regularly. Microservices are modular and independently deployable as small composable components and thus are separately testable. As testing scales up from small independent microservices through integration and end-to-end testing to larger services ecosystems, it influences the testing pyramid.

So what is a Microservice?

Microservices is a part of software architecture. It involves developing single applications that can work together as a suite of small services, each running its process while communicating with HTTP resource API mechanisms. They require minimal centralized management systems and various data storage technologies and are written in multiple programming languages.

Service-Oriented Architecture (SOA) vs. Microservices

An SOA model is a dependent Enterprise Service Bus (ESB), whereas ‘Microservices’ use faster mechanisms. SOA focuses on imperative programming, and microservices use a responses-actor based programming style. SOA models also have outsized relational database management systems, yet microservices databases like NoSQL or micro-SQL connect to conventional databases. We can conclude that the architecture methods thus differ in how each creates an integrated set of services.

Service layer and test automation API Tests

Deploy multiple versions of service API’s in parallel and make sure that the version number appears at the endpoint address. When we create a microservice, service layer testing is complemented with API tests.

Let’s discuss five approaches to automation tests for microservices.

Unit testing

It is internal to the service and is the largest in terms of volumes. It should be automated based on development language and framework. Written at unit level or collection of units as the goal is to check parts of the software to validate for functionality.

Contract testing

It treats each service individually and independently call them to verify their responses. It also reframes testing principles and maps it to service layers of a testing pyramid. Considered a cost-effective substitute for integration tests.

Integration testing

Perform verification of the services that have been individually tested and check the functioning of inter-service communications. It validates if the system works seamlessly and that the dependencies between the services are present as expected. Limit the volume of full integration tests and write layer integration tests to ensure proper integration.

End-to-End (E2E) systems testing

E2E testing verifies if the entire process flow works correctly and includes all service and database integrations. Frameworks help automate functional testing by checking that the system behaves as expected when you deploy your application in a real-world environment.

Interface testing

User Interface (UI) testing is the final level of automation testing and checks the system in a
real-time end-user scenario before the application goes live.

The benefits of microservices in a large scale systems development is still contested. That’s why we recommend you install microservices only if a regular SOA does not meet your needs. If you are considering microservices, look no further than Codoid . As a test automation services company, we ensure that all testing is performed by the right set of qualified personnel to give the best quality output to our customers. Our testing tools accelerate testing for better productivity and shorter time to market. As automation tests are an essential requirement to create successful microservice architectures, we work together with our clients to help them deploy their products by giving them the best return on their investment with us.

Selenium Wait Commands using Python to Avoid False Positives

Selenium Wait Commands using Python to Avoid False Positives

We all know that Selenium has three wait types (Implicit, Explicit, and FluentWait). How to avoid false positives using Selenium waits? Applying wait for all FindElement steps using Implicit Wait is not a right approach. If you are automating a small website or writing some Web scraping scripts, you can go with Implicit Wait. However, if you are writing automated test scripts for an web application, then our recommendation is Explicit Wait. Moreover, Implicit Wait applies the wait time for the entire browser session and you can change the wait time during run-time, however, you can’t do it for individual FindElement method call. As an automation testing company, we use Selenium Explicit Wait to avoid false positives as much as possible. In this blog article, you are going to learn Selenium Wait Commands using Python.

Implicit Wait

As we mentioned before, use Implicit Wait for simple website or Web scraping scripts and don’t mix Implicit and Explicit Waits. When you automate a full regression test suite, it requires proper Page Load and AJAX call handling using Explicit Wait. Note: By default, Implicit Wait is disabled.

from selenium import webdriver
driver = webdriver.Chrome(executable_path='chromedriver.exe')
driver.get("https://codoid.com")
driver.implicitly_wait(10)
  

Visibility of Element Located

Checking the presence of an element in DOM will not suffice our need. In addition to that the scripts need to confirm whether the web element is displayed on the web page or not. Selenium Explicit Wait has visibility_of_element_located method to check whether the web element is available in DOM and Height & Width is greater than ‘0’. Most of the automation testers are aware of this method/technique. However for novice QA automation testers to write robust automation test scripts this will be a much useful tip. Your developers can hide web elements for different reasons using the below CSS attributes.

<input type="text" id="txt1" style="opacity: 0"/>
<input type="text" id="txt1" style="visibility: hidden"/>
<input type="text" id="txt1" style="display: none"/>
<input type="text" id="txt1" style="position: absolute;top: -9999px;left: -9999px;"/>
<input type="text" id="txt1" style="clip-path: polygon(0px 0px,0px 0px,0px 0px,0px 0px);"/>
  

Note: If any HTML tag is styled using clip-path, Selenium’s visibility check does not work. This may be an issue with Selenium. Let’s wait for the comments.

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as cond
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException

driver = webdriver.Chrome(executable_path='chromedriver.exe')
wait = WebDriverWait(driver, timeout=10)

try:
    driver.get("http://google.com")
    wait.until(cond.visibility_of_element_located((By.NAME,"txt")))
except TimeoutException as e:
    print("Timed Out")
finally:
    driver.quit()
  

Wait for JavaScript Alert Presence

JavaScript Alert will pops out on your web browser after its invocation. One should use wait mechanism while handling JS Alert to avoid script failure. Sometimes, due to Ajax call response delay, JavaScript Alert invocation will also be delayed. However, your automation script should wait for the expected delay to handle the alert.

wait.until(cond.alert_is_present)
  

Selenium Explicit Wait using Lambda Expression

You can also use Python Lambda Expression to simplify the Selenium Explicit Wait commands.

elemnt = wait.until(lambda d: d.find_element_by_id("txt"))
elemnt.send_keys("Codoid")
  

In Conclusion

As a leading test automation services company, we at Codoid follow best practices to develop robust automation testing scripts. We hope you have learnt the nuances of Selenium Explicit Wait techniques to avoid false positives from this blog article. Contact us for your automation testing needs.

How to Choose the Right Team for Automated Testing

How to Choose the Right Team for Automated Testing

Executing successful test automation is far more than just writing code. It requires a highly-skilled team that is disciplined to create long-term and innovative sustainable automation.

Here are some critical factors while building your team for automated testing:

1: The reality check is that sustainable test automation can’t be made quickly or easily. That’s why a competitive test automation team must be hired so that they can maintain the software and add new features or functionality in the future. Hire experts to assemble the right QA team to design your automation framework and test scripts. A dynamic team will be able to evolve with the changing needs of your app testing. Many businesses hire third-party companies to build test automation for them, and it is necessary to find a reputable one that adopts a sustainable plan for automation tools.

2: Choose an ideal candidate with a good track record as a team leader of your automation test team because this is a critical hire. The team should be skilled in building reusable code, leveraging functions, creating well-documented methods, and intuitive naming conventions. Avoid candidates who mention record-and-playback test automation development process or keyword-driven approaches since these are not effective automation techniques and return nil on investments. Look out for manual testers who can leverage automation as a tool for efficient and consistent test-case execution. Team members should be pro-learning and follow the approach and framework decided at the beginning.

3: Bring onboard specialists like a principal developer who has a robust methodology background who can positively contribute to the growth and scalability of your app/web. Such an infrastructure specialist will focus on framework development, test management, remote execution, etc. As your team grows, such areas of app/web development will become critical to your success, and additional niche specialists for reporting, analysis, project management, and administration will become a necessity.

4: Ensure that you have sufficient team members running QA for you so that you are adequately covered throughout the entire SDLC. The automation team equips tools and languages for the manual testing team. Sometimes it is better to hire or outsource to an automated testing services company where you get access to quality assurance leaders who can monitor the usage of automation by identifying problems.

The easiest way to switch to automated from manual testing would be to take help from an automation expert who will oversee the process.

If you already have a project where you need automated testing skills, then get the goals and strategy defined by this expert and identify critical issues.

You need appropriate instruments like tools and frameworks, and employing an experienced automated tester will help establish a path for you to switch from manual testing to automation.

To make the switch, you’ll have to set up the environment which requires software and hardware, and this will take time and resources and while increasing costs.

Slowly switch the process with few testers and ensure there is proper management to avoid errors by being well-documented. A skilled automation expert will simplify this process.

At Codoid, a test automation services company, we believe that the priorities in automated testing should be as follows project, team, and then tools. First, you should analyze your product, then select the right team to solve issues and choose tools that will assist your QA testers. Whether it’s an app or website decide what browsers, functions, and OS’s you want it to support. The more familiar you are with the latest technologies used in the development, the better your testing strategy will be. If you need your software to be perfected, contact our team of expert QA engineers.

Cypress Tool Review

Cypress Tool Review

Nowadays, we come across many articles related to Cypress vs. Selenium. If you don’t choose the automation testing tool based on you needs, then you will regret forever. Let’s hit the bulls eye – Cypress is not meant to be used by software testers. It is meant for Software developers to write automated Integration tests and Unit tests against a local development server.

If you are a tester and want to use Cypress for automated smoke testing, you can run your scripts on Chrome browser, but not on Firefox, Safari, and Internet Explorer browsers. Reading the main page of the tool and writing the tool review will not suffice the needs of your audience. Product based companies are referring the tool review blog articles before choosing an automation testing tool. A thorough and unbiased tool review will help them to get quick information about a tool.

Introduction

Cypress is a developer-focused tool. If you are a tester, don’t attempt to automate your regression test suite using Cypress.io. In other words, Cypress is a suitable automation testing tool for local development builds. Whatever testing activities you can perform on development environments, you can automate them using Cypress.

Installation

You can install Cypress using npm command or it can be downloaded directly as a Zip file. Note-If you have installed using npm, then you can update newer versions easily.

Scripting Language

Cypress’ scripting language is JavaScript and it is bundled with Mocha and Chai libraries. You can describe your tests and write assertion steps with them. You can also use Intellij IDE to write test scripts. Note: In order to enable ECMA Script 6 support in Intellij, go to Settings->Languages & Frameworks->JavaScript and Select “JavaScript Language Version” as “ECMAScript 6”.

describe('Codoid Review', function(){
    it('Test 1',function(){
        expect(true).to.equal(true)
    })
})
  

Cypress Selectors

Cypress uses JQuery to find elements in DOM. Why JQuery? Simple. Cypress is for developers. Most of the modern day web developers are familiar with JQuery. It would be easy for them to write locators using JQuery syntax. By default, Cypress polls for 4 seconds to find an element. You can also change the timeout globally or on a per-step basis.

cy.get('.my-slow-selector', { timeout: 10000 })  

Project Structure

Once a Cypress project is created, it will consist fours folders – ‘fixtures’, ‘integration’, ‘plugins’, and ‘support’.

  • Test data can be stored in ‘fixtures’ folder.
  • All your test files (.js, jsx, .coffe, and .cjsx) can be written inside the ‘integration’ folder.

Visual Testing

You can also write visual regression tests using Cypress Snapshots plugin. JQuery Selector finds element, Cypress performs action on the selected element, and the expected result will be asserted. However, if you want to validate whether the page or a web element is displayed as expected to the end user with all the images and applied CSS Styles, then you need to do visual testing.

Browser Support

Cypress supports Electron, Chromium and Chrome. Firefox, Safari, and Internet Explorer browsers are not supported. As Cypress tool is for Integration and Unit tests, running on one browser should be sufficient.

In Conclusion

As a test automation company, we use multiple automation testing tools for various projects. We have a conviction that reviewing new tools and subsequently sharing the outcome by means of software testing blogs will immensely help automation test communities to select appropriate test automation tool based on their requirements and tool selection criteria. Contact us for your automation testing needs.

Getting Started with Lemoncheesecake and Behave BDD Framework

Getting Started with Lemoncheesecake and Behave BDD Framework

Lemoncheesecake is a very well known Python testing framework. As a test automation services company, we have evaluated this framework for one of your automation testing projects. After the proof of concept stage, we decided to use lemoncheesecake framework to write automation test scripts. Initially, BDD support was not available. However, now you can use behave BDD framework in lemoncheesecake. In this blog article, you will learn how to write BDD tests using lemoncheesecake and behave frameworks.

Step #1: Installation

To setup BDD using behave and lemoncheesecake, you need only two dependencies (behave and lemoncheesecake packages). That’s it.

pip install lemoncheesecake
pip install behave
  

Step #2: Setup LemonCheeseCake Project

Once the required dependencies are installed, you need to create LemonCheeseCake project. There is a command to do that. Run the below command. It will create LemonCheeseCake (LCC) project for you.

lcc bootstrap myproject
  

Step #3: Create a Feature

Create ‘features’ folder inside ‘myproject’ folder. Create a feature file inside the features folder.

Feature: LemonCheeseCake Demo
  Scenario: Demo Scenario
    Given I fill login details
    When I click login button
    Then I should see Home page
  

Step #4: Step Definition

from behave import *

import lemoncheesecake.api as lcc
from lemoncheesecake.matching import *

@given("I fill login details")
def step_impl(context):
    lcc.log_info("Pass")

@when("I click login button")
def step_impl(context):
    lcc.log_info("Pass")

@then("I should see Home page")
def step_impl(context):
    lcc.log_info("Pass")

  

Step #4: Create environment.py

Create environment.py inside myproject folder to install BDD hooks from behave.

from lemoncheesecake.bdd.behave import install_hooks
install_hooks()
  

Step #5: Run

behave features/demofeature.feature
  

Once the execution is complete, you can find LCC HTML report in reports folder. The best thing about LCC is reporting. Your team will love it once they start getting reports from LemonCheeseCake framework.

In Conclusion

Why does one need to integrate behave with LCC? We as a software testing company, write BDD and non-BDD automated scripts using Java, Python, and JavaScript languages. Let’s say for instance if u wish to write automated test scripts for data quality checks and UI validations in a test automation framework. Then LemonCheeseCake and behave combination is the ideal choice. LCC framework is gaining popularity among automation testers. We hope that you have gained some useful insights from this article. Every other day, we publish a technical blog article. Subscribe to Codoid’s Blogs to get our updates on the recent technical developments, feel free to contact us for your automation testing needs.

Why do Automation Testing Projects Fail?

Why do Automation Testing Projects Fail?

Most companies are affected by some problem or the other in new test automation services projects. Keep such windfalls in mind and build stable automation frameworks and ensure a collaborative team effort and own your automation. For automation to be successful, companies should approach it with realistic goals, the right attitude, and a willingness to make it work. Here are eight reasons your automation project can fail:

Unable to describe individual business goals that need to be solved:Return On Investment (ROI) should be understood if you are running automation tied to a business goal, then business leaders will stay invested. Use an open-source tool and hook it into your build server and spend time making your project feature-rich by writing test cases that are aligned to the same business goal.

Automation should be treated as a timed activity and not a process:Make sure developers who build the automation framework hand it over to a competent technical QA team to carry forward. Automation is a software project and should be flexible and easy to maintain. Continuous work needs to be done to update the framework, like new updates, features, and requirements. Most frameworks are tied into other systems like build, metrics, and cloud services, so keep it synced as it evolves.

A team creates it without sole responsibility for standards:Slower test case development by a smaller team that builds in redundancy and regularly reviews and gives feedback to produce quicker value to the project. This team checks requirements, understand business goals, and builds infrastructure to drive the project forward. With strong leadership, an approved roadmap, and strict quality controls, the team should be confident in their tests and its ability to produce reliable results. Each test should be reviewed to ensure it fits, and the team’s QA engineers should be autonomous.

Understand what to and what not to automate:It is imperative to understand that it is good to automate certain functionalities of a webpage and that some scenarios are better tested manually. Only automate stable aspects of your app or web product that is not prone to change but needs to be continuously retested. Save valuable testing effort by automating such repetitive tasks and ensure testers spend time performing exploratory testing.

The team isn’t technically skilled enough to handle the project:Testers should have a certain level of technical expertise to do automation the right way. Such QA team members can be expensive, and not all companies can afford to hire such automation engineers. So hire a few technical experts, but if it isn’t an option, invest in a tool that can help you automate the processes.

Lack of visibility around automation techniques:To be more visible, create an automation document listing all features automated, modules covered, and framework set up. Your method of automation should be clearly defined for the entire Software Development Lifecycle (SDLC). Automation tasks need to be treated separately to make them easier to manage. Make the results visible to the whole team via dashboards and discuss daily progress in team huddles. Conduct sessions that cover different trends, ethical practices, and tools. Make your automation a collaborative effort by involving the complete team in planning and writing it.

Check the testability of the application:Build an application that is easily testable from all (unit, system, integration, and acceptance) levels. Don’t build complex applications that cannot be tested and ensure the testability of a story, feature, or requirement during backlog sprucing, and sprint planning meetings before the development begins. It will alleviate problems later in the SDLC.

Vague automation goals:A robust automation framework seamlessly integrates with Continuous Integration/Continuous Delivery (CI/CD) pipeline, is easily maintainable because it gives quick feedback and runs consistently. Identify two or three high-level functionalities and collect input from automating and stabilizing them first. Separate your automation suites for smoke tests (run after every code check-in) and regression tests (run daily and covers different functionalities).

In summary, these common reasons that cause automation to fail need to be avoided for a successful automation implementation. Keep your projects focused on increasing ROI and business value and hire a highly skilled team or test automation company to ensure a smooth transition. Automation testing companies, like Codoid, can help you in this respect.