Posts

Automated Testing on Azure DevOps

If you are looking for automated testing for any of your applications and would like to integrate it with your Azure DevOps infrastructure, Optimus Information has a “ready to deploy” Test Automation solution for you.

Our Azure DevOps based test automation solution uses the latest Azure CI/CD features and offers the following functionalities:

1. Configure automated test cycles using Azure DevOps

2. Schedule and execute Web UI and REST API test scripts on cloud using Azure VMs

    • Self-serviced virtual machines and PaaS resources for testing using Azure DevTest labs
    • Supports automated test scripts developed in Java or C# using Selenium WebDriver, REST Assured and RestSharp

    3. Distribution of apps to beta testers and your collaborators with Azure App Center

      • Selection from a large variety of test devices using the App Center Test Cloud
      • Supports popular frameworks like Xamarin.UITest, Appium, XCUI Test etc.

      4. Test result reporting and logging with screen shots and 6 month data retention with App Center

        • Support for notification over mail or other communication tools like Slack

        5. Data persistence support using AzureSQL service

        6. Integration with PowerBI Embedded for reporting and analytics

        7. Built in test script source code management using Azure DevOps

          • Supports integration with third party Git providers like Github if required

          8. Built in test case management for test plans using Azure Test Plans

            • Custom integration possible with other tools like TestLink where supported

            9. Concurrent execution

            10. Ability to start automated testing in short time frame with expense control

            Cloud is important to our customers. The Optimus test automation framework on Azure makes it possible for our customers to seamlessly integrate test automation into their cloud-based development as well as their test and production environments. Contact us to get a more in-depth look to to get a demonstration.

            Automated-Testing-Solution-on-Azure-2-e1554082144564 Automated Testing on Azure DevOps
            All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

            HP UFT/QTP vs. Selenium – Automated Test Tool Comparison

            HP Quick Test Pro, also known as HP Unified Functional Testing, is currently a well-known force in the web-based testing market, but Selenium is quickly gaining mindshare and advocates as a more capable, open-source competitor. There are several clear-cut distinctions between each test tool that should make choosing one or the other a straightforward decision in most cases.

            Comparison Highlights Between QTP and Selenium

            Cost – QTP requires a license fee for acquisition and more fees for upgrades and add-ons, but Selenium is a totally free, open-source download and will always be so.

            Testing Applicability – Selenium is only for testing web-based apps, whereas QTP can test client-server and desktop applications in addition to web-based apps.

            Cloud Ready – QTP’s one-script/one-machine execution model cannot make efficient use of distributed test execution via cloud-based infrastructure. Selenium-Grid is specifically designed to run simultaneous tests on different machines using different browsers and different operating systems in parallel. Thus, it is a perfect match for cloud-based testing architectures and services.

            Execution Efficiency – QTP tests one application per machine, whereas Selenium can execute multiple, simultaneous tests on a single machine. Furthermore, QTP script execution takes more RAM and CPU power than does Selenium. QTP can run in multiple Windows VMs, but these are more resource-hungry than Linux VMs, which Selenium can utilize.

            Browser Compatibility – QTP works with four browsers, albeit some of the most popular ones, whereas Selenium works with those plus five more browsers of which two are headless. Headless browsers provide additional test execution efficiency.

            Language Compatibility – QTP tests are written in Microsoft’s VB Script. Selenium tests can be written in one of nine different popular languages including Java, JavaScript, Perl, Python and PHP. Thus, you can adapt it to the programming resources you have on hand.

            OS Compatibility – Selenium tests applications on all major OSs including Windows, Linux, OS X, Solaris, iOS and Android. QTP runs only on Windows.

            Support – Selenium is supported by a vibrant, active user community, but it does not have dedicated support staff, whereas you can buy technical support for QTP. For some issues, paid support provides faster resolution cycles.

            Technical Challenges When Using Selenium

            Although Selenium has a number of meaningful advantages over QTP, including its much broader compatibility with different app and test configurations, it is not without technical limitations:

            • Selenium is not uniformly compatible across browsers. It is most compatible with Firefox, so scripts developed for Firefox may need tweaking to run in IE or Chrome.
            • It has no object types other than WebElement or Select, and no repository for storing object mappings.
            • There is no inherent support for data-driven testing.
            • HTML tables and other elements require coding to work correctly.
            • Image-based tests are harder to accomplish.
            • Dialog box support is limited.
            • In general, Selenium requires a higher level of coding skills

            Some of these issues are resolved via testing frameworks compatible with Selenium. However, these may add upfront development effort when developing or integrating with such a framework.

            Tips on Migrating from QTP to Selenium

            When migrating from QTP to Selenium, take a piecemeal, trial approach to get started. Choose a script language with which the team has the most experience already, or one that best supports the type of automation framework you plan to build.

            However, at the beginning, defer building a framework and simply write a handful of simple Selenium scripts. Collect notes about issues as you go along. Incorporated those learnings into building larger test suites. It is easier to write Selenium scripts from scratch than trying to port them directly because of the many differences between QTP and Selenium.

            Once you become familiar with Selenium and commence building an automation framework, look at tools that play well with Selenium such as Maven for compilation, Test NG to drive unit, functional and integration tests and Jenkins or Hudson if you plan to use a Continuous Integration methodology.

            If your web-based automation test projects require the highest flexibility across browsers, OSs and script languages at the lowest cost, then Selenium is the clear winner. However, especially in the earliest stages of adoption, more skilled programming resources are required for script generation and integration into an automation framework of your choice.

            The many pros and cons between QTP and Selenium may present difficult choices if you currently use QTP, but otherwise Selenium provides the better payback and versatility over the medium-term.

            Selenium Testing: Advantages and Disadvantages

            When we speak of Selenium, we are actually talking about both its flavours: Selenium WebDriver and Selenium IDE. Both automate browsers in support of web application testing. WebDriver is typically used to create browser-based regression tests, whereas Selenium IDE is most advantageous in creating unit tests, exploratory tests and one-off bug reproduction scripts. There is no need to make further distinctions between the two, however, when discussing Selenium’s advantages and disadvantages.

            Why Selenium Is Popular

            Not only is Selenium free, it is open source. It is used by many major online enterprises for testing their web interfaces including Facebook and Google. Once set up, it is delivers an efficient way to generate test scripts, validate functionality and reuse these scripts in automated test frameworks.
            It is not a case of having your cake and eating it too unfortunately. Selenium requires a significant amount of technical expertise and third-party tools to become fully functional. Additionally, its ease of use at the GUI level can mislead testers into overusing it for testing lower layers in the software stack. However, let us start with the positive attributes of testing with Selenium.

            Selenium Pros

            • Selenium has no upfront, out-of-pocket costs. It is a free download and support is free too, although it is community-based.
            • Selenium tests are, in principle, able to run under multiple browsers.
            • Although Selenium has its own script language, you are not limited to writing in that language since it can work with language bindings to support whatever your developers/testers are comfortable with including C#, Java, JavaScript, PHP, Python and others.
            • Selenium scripts are created by recording actions using the web application under test running in a browser. These scripts can be saved and re-run at any time. Selenium tests can be created manually through the use of web development tools such as Firebug also.
            • Selenium does not restrict QA’s choice of reporting tools, build systems or any other aspect of their testing framework. It integrates well with popular tools such as Hudson, SauceLabs, Selenium-Grid, QMetry and others.
            • It also supports web applications that implement part of their functionality within the browser using JavaScript and AJAX technologies.

            Because of its many advantages, Selenium finds wide usage for UI, regression, unit and acceptance testing. Because of the rapid test development it enables, it is quite popular for quick-cycle development methodologies such as Agile or Extreme Programming. Selenium is also popular with IT staff who automate repetitive, web-based administrative tasks.

            Selenium Cons

            • Selenium is not a complete, comprehensive solution to fully automating the testing of web applications. It requires third-party frameworks, language bindings and so on to be truly effective.
            • Despite its acceptance of other test script languages, it demands higher-level technical skills, such as programming, from QA team members.
            • It has no test management facilities. Test scripts are saved as simple files without attributes. Organizing individual scripts in any fashion via a user interface requires a third-party tool or a custom application.
            • Because native “Selenese” test scripts are not user-friendly in terms of readability, they are difficult to modify. Many testers simply resort to discarding the original scripts and recording them again, which can be time consuming.
            • Selenium does not support test and result sharing in anything but a manual way.
            • There is no support for running tests in parallel on a single computer.
            • Selenium has technical issues with browsers other than Firefox. Furthermore, it does not support conditionals, loops and has trouble finding locators without the help of additional tools such as Firebug.

            A final drawback to Selenium, which has nothing to do with Selenium itself, is that it enables over-reliance by testers for testing software layers below the GUI, since test scripts are relatively quick to produce. However, such an inversion of the traditional testing pyramid, especially in end-to-end automated testing environments has serious efficiency and test maintenance issues.

            The advantages of Selenium for increasing the efficiency of web application testing at the GUI level outweigh its disadvantages, especially with regard to cost and the shortening of test cycles due to efficient automated test generation. If your organization is willing to tackle the technical and test management issues, Selenium is an excellent tool suite with which to improve the quality of web-based testing.

            Getting Started with Selenium WebDriver

            The most popular solution for automating tests for browser-based apps is the Selenium tool suite, which consists of Selenium IDE, Selenium RC, WebDriver and Selenium Grid. WebDriver is the successor of Selenium RC and also goes by Selenium 2.0.

            With WebDriver, testers can choose among several programming languages to develop test scripts. Testers without programming experience would start by using the Selenium IDE as a Firefox plugin to create scripts due to its simplicity.

            WebDriver Features

            • WebDriver supports Java, C#, PHP, Perl, Ruby or Python programs.
            • It supports the following browsers: Google Chrome, IE 6 through 10, Firefox, Safari and Opera.
            • Web-app tests can be run via “headless” browsers HtmlUnit and phantomjs.
            • Mobile browsers are supported via AndroidDriver and IphoneDriver.
            • WebDriver enables complex browser interactions including navigation, tab switching, dropdowns, Ajax calls and JavaScript alert handling.
            • WebDriver makes direct browser calls at the OS level without injecting JavaScript into the browser.

            WebDriver does not require that a Selenium server be running if the WebDriver API, browser and tests are running on one machine. Selenium server is required when connecting to a different browser on a remote machine or when using Selenium-Grid.

            Setting up a WebDriver Project with Java

            Project Setup

            To begin using WebDriver with Java, download the following components:

            • Java SE Development Kit 8
            • The Maven build tool
            • Either IntelliJ Community Edition or the Eclipse IDE
            • Firefox
            • The JUnit Java test framework that executes the test code

            Selenium WebDriver is downloaded indirectly as a dependency by Maven. Set up the dependencies for JUnit and WebDriver in a Maven pom.xml file. The dependency section looks like this within the <project> section:

            <dependencies>

            <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>4.12</version>

            <scope>test</scope>

            </dependency>

            <dependency>

            <groupId>org.seleniumhq.selenium</groupId>

            <artifactId>selenium-java</artifactId>

            <version>2.47.1</version>

            </dependency>

            </dependencies>

            The latest WebDriver version is 2.47.1 as of this article’s date, but you can check for newer versions here: http://www.seleniumhq.org/download/

            Once the Maven configuration file is set up, execute the project build from the command line using “mvn clean install” to download Selenium into the project.

            Example Test Code to Access a Page Tab

            Developing test code for WebDriver is easy, since it does not require a test framework. Tests are run standalone, which makes them ideal for unit testing.

            The following code lines are simple examples of common WebDriver API calls to provide a hint of how WebDriver works. These lines start a Firefox browser session and navigate to the Selenium home page.

            Webdriver driver = new FirefoxDriver(); // Initialize a Firefox driver instance
            driver.get(“http://seleniumhg.org”); // Visit the Selenium home page

            To access page elements, use the WebElement class, which has a findElement method that can access page elements eight different ways such as by an ID, a name, an Xpath and so on. In this example, the script accesses the Selenium home page projects tab and clicks it. The tab is found by name, which is found by examining the page source.

            WebElement projectTab = driver.findElement(By.name(“menu_projects”));
            WebElement projectLink = projectTab.findElement(By.tagName(“a”));
            projectLink.click();

            Remember that WebDriver methods are used in the context of loading a browser page and WebElement methods are used when accessing local data on a page.

            Many other WebDriver methods are available for page interaction:

            • findElements enumerates children of the WebElement returned by findElement
            • getAttribute retrieves values for attributes such as classes or ids
            • getTagName retrieves tag names for elements such as lists or anchors
            • getText retrieves element text such as URL text or a name
            • sendKeys is used to enter input into any field
            • clear erases text in an input field
            • isDisplayed asks if a specific page element is visible
            • isEnabled asks if interaction with a specific element is possible
            • isSelected asks if a specific element is in a selected state

            Consult the WebDriver API documentation to survey the full API: https://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/WebDriver.html

            Synchronization

            WebDriver also includes methods for managing test scripts on dynamic pages that use JavaScript for downloading elements or modifying the page based on user interactions. To avoid test scripts unnecessarily throwing exceptions because an element has not loaded yet, explicit and implicit waits are provided.

            Implicit waits repeatedly try locating a missing element up to a maximum timeout. An explicit wait is implemented by WebDriverWait and used together with ExpectedConditions to wait for specific element states for a specified time.

            Selenium WebDriver is the most popular automation tool for developing test scripts for web pages and web applications. It accurately and efficiently mimics real user interaction using several well-known languages and a concise, user-friendly API. This article has provided a brief introduction to Selenium WebDriver’s main features and hit a few highlights demonstrating how easy it is to get started using WebDriver with Java and a Firefox browser.

            Events

            Nothing Found

            Sorry, no posts matched your criteria