October 2018 Summaries
40 posts from Octopus Deploy
Filter
Month:
Year:
Post Summaries
Back to Blog
Octopus Deploy has introduced enhanced support for Kubernetes deployments, aiming to simplify the adoption and migration process for teams by balancing the platform's inherent complexity with ease-of-use. This includes the ability to add Kubernetes Clusters as deployment targets, support for Helm Chart feeds, and new deployment step templates for deploying Docker containers, executing scripts with kubectl, and using a Helm Update step. Additionally, the Offline Package Drop feature now allows deployment bundles to be stored as Octopus Artifacts, which is particularly beneficial for Octopus Cloud instances. The latest release also updates various Cloud SDKs, notably including a significant upgrade of Azure PowerShell modules to resolve previous issues. Users are encouraged to review the release notes for detailed information on these updates, and self-hosted customers can download the latest release immediately, while Octopus Cloud users will receive the updates during the scheduled maintenance window.
Oct 25, 2018
457 words in the original blog post.
Bob Walker, a solutions architect at Octopus Deploy, details his experiences and challenges in deploying TeamCity, a build server, onto a Kubernetes cluster using Octopus Deploy. Initially, Walker emphasizes the flexibility Octopus Deploy offers by supporting various build servers, which allows clients to use their preferred tools while he learns and demonstrates different build systems. He outlines the step-by-step process of setting up a Kubernetes cluster on Google Cloud Platform, configuring Octopus Deploy to connect to it, and deploying TeamCity with persistent storage to retain configurations across deployments. Despite some hurdles, such as Kubernetes not yet supporting Windows containers natively and the complexity of accessing Docker from within a container, Walker successfully configures TeamCity and a build agent, albeit with some limitations. He concludes that while Kubernetes and Docker offer significant advantages, they are not universally applicable solutions and understanding their limitations is crucial.
Oct 11, 2018
3,706 words in the original blog post.
The blog post by Matthew Casperson discusses implementing canary deployments in Kubernetes using the Voyager Ingress Controller and Octopus. Canary deployments allow a small portion of user traffic to be directed to a new application version to monitor for errors, gradually increasing traffic if the deployment is successful. Kubernetes is well-suited for this strategy due to its flexibility in managing deployments and traffic routing. The guide details the prerequisites, including a Kubernetes cluster and Helm installation, and describes setting up an external feed and deploying a Voyager Helm chart. It explains creating canary environments in Octopus to facilitate traffic management and rollback capabilities, forming a lifecycle with phases for canary progression. The deployment process involves creating Kubernetes targets with limited permissions, deploying stable and canary deployment resources, setting up services to manage traffic distribution, and using Voyager Ingress to handle traffic routing. The post emphasizes how these steps enable monitoring and controlling the deployment process, allowing for effective rollbacks if issues arise, and ultimately ensuring a smooth transition to new application versions.
Oct 10, 2018
3,715 words in the original blog post.
In a discussion about the importance of DevOps, Bob Walker emphasizes the need for Development and Operations teams to collaborate towards common goals, such as automating deployments, including database changes, to reduce risk and improve efficiency. He acknowledges that while automating code deployments is often prioritized, databases are frequently overlooked, despite being critical to applications. Walker highlights the efforts of Octopus Deploy in promoting comprehensive automation across code, databases, and infrastructure, and announces upcoming presentations by himself and colleague Derek Campbell at the SQL in the City Summit, where they will discuss the advantages of Database DevOps. He encourages participation in these events, offering registration discounts, and underscores his role as Field CTO at Octopus Deploy, focusing on stakeholder engagement and thought leadership.
Oct 03, 2018
375 words in the original blog post.
Matthew Casperson's article, part of a series on creating a Selenium WebDriver test framework, explores the complexities and solutions for cross-browser testing using BrowserStack. Traditional testing methods were limited by operating system compatibility, as browsers like Safari, Internet Explorer, and Edge were not universally supported across all systems. BrowserStack, a paid service with free options through collaborations with Mozilla and Microsoft, enables extensive testing across a wide range of browsers and operating systems. The article details the process of setting up and configuring a BrowserStack account, including retrieving necessary credentials and using environment variables for secure configuration. It explains the construction of a RemoteDriver instance to connect to BrowserStack services and demonstrates the creation of decorators to manage browser capabilities, using Edge as an example. Through this setup, tests can be run against browsers on remote servers, with the flexibility to expand testing to other browsers and devices offered by BrowserStack, aiming to simplify large-scale cross-browser testing in a development environment.
Oct 02, 2018
1,920 words in the original blog post.
Matthew Casperson discusses a common configuration issue encountered when using SOCKS proxies with Selenium WebDriver in Firefox, which results in a misconfiguration error. The error stems from the failure to define the SOCKS proxy version, leading to a failed assertion that an integer must be positive. Casperson explains that the error can be traced back to the file "chrome://marionette/content/session.js" bundled with Firefox, where the offending line of code is located. Although theoretically, the SOCKS proxy version can be set within the BrowserMobDecorator class to rectify this, practical issues with the WebDriver library may persist. Casperson emphasizes that understanding Firefox stack traces with URLs starting with "chrome://marionette/" allows developers to access these files directly in Firefox, aiding in debugging the root cause of errors. This post is part of a series focused on building a Selenium WebDriver test framework.
Oct 02, 2018
511 words in the original blog post.
The blog post by Matthew Casperson explores the use of the BrowserMob proxy tool within a Selenium WebDriver test framework to manipulate network requests, enhancing testing efficiency by blocking unnecessary assets and simulating service failures. It explains the implementation of a method called `blockRequestTo`, which allows users to intercept requests to specific URLs and return predefined HTTP response codes, thereby controlling what content is loaded during tests. This approach can optimize test performance by preventing the loading of non-essential elements such as images and blocking third-party services, which can help in simulating scenarios like external service failures. Additionally, the post highlights the importance of managing proxy settings manually after tests are completed, as the BrowserMob proxy's closure stops the browser's network communication, necessitating manual adjustments for further interactions with the web page.
Oct 02, 2018
1,179 words in the original blog post.
The blog post by Matthew Casperson provides a detailed guide on setting up a Selenium WebDriver test framework within a Maven project using IntelliJ IDEA, specifically focusing on testing with Chrome and Firefox browsers. It explains the necessary steps to create a directory structure for test classes, write a simple test to automate opening a URL using the ChromeDriver, and addresses common issues such as the IllegalStateException caused by the absence of a ChromeDriver executable, offering solutions like configuring the `webdriver.chrome.driver` system property or adding the executable to the PATH environment variable. Additionally, the post covers how to prevent the browser from closing automatically after a test for debugging purposes and introduces similar steps to run tests using the FirefoxDriver, thereby creating a foundational framework for more complex automated tests.
Oct 02, 2018
1,939 words in the original blog post.
Matthew Casperson discusses the use of Amazon Web Services (AWS) S3 to host public websites as part of a series on creating a Selenium WebDriver test framework. The article outlines the process of using AWS S3 to host web pages, which involves creating a globally unique bucket, uploading HTML files and resources, and adjusting permissions to make the files publicly accessible. By doing so, developers can generate public URLs for web pages, enabling tests on platforms without local HTML file access. This allows for the execution of tests across various browsers and mobile devices, a capability that will be explored further in the series with services like BrowserStack. The post highlights the benefits of AWS's free tier, which makes it an economical choice for hosting small web pages used in testing scenarios.
Oct 02, 2018
884 words in the original blog post.
In this detailed exploration of integrating Cucumber with a Selenium WebDriver test framework, Matthew Casperson discusses the challenges of making Java-based test code accessible to non-developers and offers a solution using the Cucumber library. By employing the Gherkin language, which uses natural language syntax, stakeholders can write and understand tests without needing extensive programming knowledge. The process involves linking Gherkin steps to Java methods through annotations like @Given, @When, @And, and @Then, which match regular expressions to method parameters. The post explains how to structure the framework to accommodate Cucumber's limitations, such as avoiding inheritance in classes with annotations and using packages strategically. A sample test demonstrates opening and closing a browser using the framework, showcasing the potential for creating readable and maintainable end-to-end tests. The article forms part of a series on building a Selenium WebDriver test framework, indicating future posts will expand on integrating Cucumber with more complex testing scenarios.
Oct 02, 2018
2,383 words in the original blog post.
Matthew Casperson's blog post, published on October 2, 2018, is part of a series focused on creating a Selenium WebDriver test framework using Java. The article details the initial steps of setting up a Maven Project Object Model (POM) file, which is crucial for determining how the code is built, managing dependencies, and running tests. Key components of the POM file, such as the <project> element, Group, Artifact, and Version identifiers (GAV), as well as packaging, properties, plugins, and dependencies, are explained in detail. The post emphasizes the importance of setting the project.build.sourceEncoding property to UTF-8 to prevent encoding issues across different operating systems. It also discusses configuring the maven-compiler-plugin for Java 1.8 compatibility and highlights the integration of JUnit and Selenium Java libraries for testing purposes. Casperson concludes by guiding readers through importing the POM file into IntelliJ and verifying its setup, laying the groundwork for subsequent posts on implementing WebDriver tests.
Oct 02, 2018
1,761 words in the original blog post.
Matthew Casperson's post, part of a series on creating a Selenium WebDriver test framework, details the process of setting up an AWS Lambda function to execute WebDriver tests using Cucumber and Gherkin feature files. The framework utilizes a LambdaEntry class that downloads necessary Chrome binaries from an S3 bucket, creates temporary files for testing, and executes the tests, generating JSON reports of the results. The post underscores the importance of managing resources, as Lambda may reuse underlying Linux instances, and highlights a method for converting Gherkin feature files into JSON strings for Lambda compatibility. By leveraging AWS services such as S3 and Lambda, the solution enables scalable and efficient test execution, although the current method of running tests via the Lambda web console is noted as inconvenient, with a future post promising a method to trigger tests through HTTP requests.
Oct 02, 2018
3,811 words in the original blog post.
In this detailed exploration of creating a Selenium WebDriver test framework, the text delves into the integration of Gherkin syntax with Java to enhance test automation using the Cucumber library. The process involves mapping methods to Gherkin steps through annotations, focusing on methods that are applicable in Gherkin's context, while excluding those that handle internal functionalities or return values. The text demonstrates the creation of a feature file for a TicketMonster application, illustrating how Gherkin can transform test instructions into nearly plain English. It discusses the implementation of a default explicit wait time to streamline test steps and introduces the concept of aliases to replace cumbersome locators with more readable names, thereby improving the clarity and maintainability of test scripts. This framework allows tests to be executed with a clear and concise syntax, making them accessible to both technical and non-technical stakeholders, showcasing the synergy between Gherkin's readability and Cucumber's execution capabilities.
Oct 02, 2018
4,068 words in the original blog post.
Matthew Casperson's post from October 2018 discusses the integration of BrowserMob proxy into a Selenium WebDriver test framework, enabling the capture and interception of network requests during tests. By adding BrowserMob as a Maven dependency and creating a decorator, the framework configures a proxy server that directs HTTP and HTTPS traffic through a local proxy, enhancing network request monitoring capabilities. The setup involves creating an instance of BrowserMobProxyServer, configuring it within the DesiredCapabilities object, and updating the AutomatedBrowserFactory to incorporate the BrowserMobDecorator. This allows tests to run transparently while providing the means to observe and manipulate network requests, which is not possible with WebDriver alone. The article also hints at further exploration of BrowserMob's features and addresses potential misconfigurations in proxy setups.
Oct 02, 2018
1,196 words in the original blog post.
Matthew Casperson's article discusses the integration of AWS services to create a scalable and reliable Selenium WebDriver test framework that runs tests asynchronously due to the time limits of API Gateway and Lambda requests. To address the issue of returning test results, the framework uses AWS Simple Email Service (SES) to send the test outcomes via email, allowing for seamless communication without building custom solutions. The process involves verifying email addresses in the SES console, adding the necessary AWS Java SDK dependency in the project's configuration file, and incorporating email sending functionality into the code. Additionally, the framework requires updating the runCucumber method to save test results in a text file and send them through email, while configuring the necessary permissions in AWS Identity and Access Management (IAM) to allow the Lambda function to use SES. Upon deploying the updated configuration with Serverless, test results are efficiently communicated through email, demonstrating the effectiveness of cloud services in enhancing test execution and result dissemination.
Oct 02, 2018
1,507 words in the original blog post.
The blog post by Matthew Casperson, published on October 2, 2018, details the process of setting up a simple AWS Lambda function using the Serverless framework as part of a series on creating a Selenium WebDriver test framework. Following the configuration of necessary AWS credentials and uploading of required binaries to S3, the post outlines the addition of dependencies such as aws-lambda-java-core, aws-java-sdk-lambda, and commons-io to facilitate the Lambda function's operation. It explains the process of writing a basic Lambda function that returns a boolean value and details the setup of a serverless.yml configuration file to define service, provider, package, and function details for deployment. The post describes how to manually build and deploy the Lambda function using the Serverless CLI and concludes with a successful test of the function, setting the stage for subsequent posts to expand its functionality to run WebDriver tests.
Oct 02, 2018
1,250 words in the original blog post.
Matthew Casperson's blog post, part of a series on creating a Selenium WebDriver test framework, delves into integrating the AutomatedBrowserBase class with Cucumber by expanding the Gherkin dialect for writing WebDriver tests. It discusses the use of regular expressions to define methods for interacting with web pages, including navigating to URLs and clicking elements by their IDs, with or without explicit waits. The post explains the significance of capture groups, non-capture groups, and character classes in creating flexible and powerful regular expressions, which are mapped to Gherkin steps for test automation. Additionally, it provides practical examples of regular expressions and highlights their role in enhancing the functionality and precision of automated testing scripts within the framework.
Oct 02, 2018
1,618 words in the original blog post.
Matthew Casperson's blog post discusses the challenges and solutions for efficiently running UI tests using Selenium WebDriver. Previously, the sequential execution of tests was slow and inefficient, taking hours to complete, which posed a bottleneck in the CI pipeline. The post highlights how leveraging AWS Lambda and Chrome headless browser can significantly reduce testing times from hours to seconds by automatically scaling the testing application as needed. AWS Lambda handles the infrastructure, deploying and running code at scale, while Serverless, a Node.js application, is used for deploying functions to AWS. The post provides a guide on setting up the Serverless framework, configuring AWS credentials, and deploying code, although it leaves more complex configurations for running WebDriver tests for a subsequent entry in the series.
Oct 02, 2018
1,260 words in the original blog post.
In this blog post, Matthew Casperson introduces an advanced approach to creating a Selenium WebDriver test framework that enhances flexibility and efficiency in locating web page elements. Casperson discusses the limitations of traditional methods that require specifying how elements are located, such as by ID or XPath, and proposes a more dynamic solution using a single interface, SimpleBy, which allows WebDriver to determine the best locator method. This interface returns the first element matching any locator type, such as ID, XPath, or CSS selector, and is implemented with a custom class, SimpleByImpl, which cycles through various locator strategies within a specified wait time. To further streamline test writing, Casperson introduces methods in the AutomatedBrowser interface that abstract the element interaction process, allowing testers to focus on test logic without predefining locator types. This approach minimizes the need for synchronization between locators and methods, improving both the readability and maintainability of test scripts. The post is part of a series on building a Selenium WebDriver test framework and emphasizes the importance of using explicit waits in conjunction with this dynamic locator strategy to avoid potential conflicts with implicit waits.
Oct 02, 2018
2,716 words in the original blog post.
Matthew Casperson's blog post outlines the development of a Selenium WebDriver test framework through the creation of an AutomatedBrowserFactory class, which simplifies the configuration of browser drivers like ChromeDriver and FirefoxDriver. The framework employs the decorator pattern to build flexible, browser-agnostic testing capabilities, allowing for the easy addition of features such as proxies and remote browsers without deep class hierarchies. The post details the setup process, including directory configuration in IntelliJ and the implementation of the AutomatedBrowser interface, which defines key browser interactions. By utilizing the AutomatedBrowserBase class, decorators such as ChromeDecorator and FirefoxDecorator manage browser-specific logic, while a WebDriverDecorator facilitates browser actions using the WebDriver API. The AutomatedBrowserFactory is updated to utilize these decorators, enabling the creation of customized browser instances, which are then tested using JUnit parameterization to run tests across multiple browsers, demonstrating the framework's adaptability and ease of use for future testing scenarios.
Oct 02, 2018
2,309 words in the original blog post.
In the context of creating a Selenium WebDriver test framework, this text discusses the use of different methods for locating elements on a web page, focusing on XPath and CSS selectors as alternatives to ID attributes, which may not always be available or reliable. XPath provides a unique method for identifying elements through a query language, though it can be complex, while CSS selectors, commonly used by web developers for styling, offer a more familiar and straightforward approach. The article details how to implement these methods within a test framework by adding corresponding functions to the AutomatedBrowser interface and WebDriverDecorator class, enabling interactions with web elements through generated XPaths or CSS selectors. It also highlights that, although IDs are the most efficient and reliable way to locate elements when available, CSS selectors are preferred over XPaths in the absence of usable IDs due to their familiarity and ease of use.
Oct 02, 2018
1,644 words in the original blog post.
Matthew Casperson's blog post discusses the limitations of sequential testing in Selenium WebDriver and proposes the Page Object Model (POM) design pattern as a solution. Sequential testing, where each interaction with a web page is defined in order, can be confusing and non-reusable, particularly when identifiers are not descriptive. The POM design pattern addresses these issues by encapsulating page interactions within classes, allowing for more descriptive method names and reusability across tests. Casperson illustrates this with a framework for testing the TicketMonster application, creating classes for each page like MainPage, EventsPage, VenuePage, CheckoutPage, and ConfirmationPage. These classes extend a BasePage class, which provides shared resources like an AutomatedBrowser instance and a default wait time for interactions. The design enhances maintainability by using constant variables for URLs and element identifiers, reducing hard-coded dependencies in test methods. This approach allows for more streamlined, readable, and maintainable test scripts that abstract away intricate details, enabling tests to focus on the user journey rather than the implementation specifics.
Oct 02, 2018
2,848 words in the original blog post.
In Matthew Casperson's blog post, the interaction between implicit and explicit waits in Selenium WebDriver test frameworks is explored, demonstrating how they affect the performance and outcomes of automated tests. Through a series of test scenarios, the post reveals that when both types of waits are used concurrently, the longer wait time dominates, potentially leading to unexpected test durations. The tests show that an implicit wait can inadvertently extend an explicit wait, resulting in misleading test results such as false positives. To address this issue, Casperson suggests using explicit waits exclusively, which provide more precise control over the timing of interactions by enforcing the state of an element within a specified duration, thus enhancing test reliability. The post concludes by recommending the disabling of implicit waits to fully leverage the advantages of explicit waits in automated testing, emphasizing the importance of careful wait configuration in ensuring accurate and efficient tests.
Oct 02, 2018
1,316 words in the original blog post.
Matthew Casperson's blog post from October 2, 2018, explains how to create a Selenium WebDriver test framework using a Maven project to build and package code into a JAR file. Initially, the JAR file only contains the project's classes, excluding necessary libraries like WebDriver and Cucumber. To address this, an UberJAR is created using Maven's Shade plugin, which packages the application with all dependencies into a single, self-contained file suitable for AWS Lambda deployment. The post also guides users on skipping tests during the Maven package lifecycle to streamline the build process, allowing for quicker production of the JAR files. Future posts in the series will cover running WebDriver tests in Lambda and using a Serverless application to publish the UberJAR.
Oct 02, 2018
688 words in the original blog post.
Matthew Casperson's article discusses the integration of headless browser testing into Selenium WebDriver frameworks, focusing on the transition from using PhantomJS to leveraging the native headless capabilities of modern browsers like Chrome and Firefox. The text explains the configuration process for running WebDriver tests in headless environments, which are particularly useful for continuous integration and deployment scenarios where visual monitoring is unnecessary. It highlights the use of the DesiredCapabilities class to manage generic browser settings, and how browser-specific options classes like ChromeOptions and FirefoxOptions are used to enable headless mode. The article emphasizes the simplicity and practicality of using headless modes in popular browsers, which aligns testing environments more closely with real-world user experiences by using the same browser engines. Additionally, the text touches on future enhancements, such as integrating with platforms like Travis CI and AWS Lambda, and the potential for extending browser capabilities through custom proxies in upcoming posts.
Oct 02, 2018
1,732 words in the original blog post.
Matthew Casperson's blog post discusses using BrowserMob to enhance Selenium WebDriver test frameworks by intercepting and altering network responses. The article explains how BrowserMob allows testers to block unnecessary network requests, mock responses for deterministic tests, and modify responses to target specific edge cases. A practical example is provided where a simple web page retrieves the sunset time in Hawaii from the Yahoo weather API, with BrowserMob used to replace this response with a fixed value for testing purposes. The process involves setting up a response filter to modify the API response, ensuring tests have predictable inputs, and allowing simulation of difficult-to-recreate conditions. This technique is demonstrated by altering API responses to provide controlled test scenarios, illustrating the utility of BrowserMob in creating reliable and flexible automated tests.
Oct 02, 2018
1,486 words in the original blog post.
In this blog post, Matthew Casperson discusses enhancing a Selenium WebDriver test framework using the Page Object Model (POM) design pattern to verify ticket prices in an application. The post describes the implementation of new methods in the CheckoutPage class to support this test, including defining a regular expression to extract and convert ticket prices from strings and methods for selecting different event sections. It explains how the POM pattern facilitated the test creation by abstracting the web application's details into reusable Java objects, allowing the test to focus on verifying price ranges across various sections without being bogged down by implementation specifics. The utility of the POM design pattern is highlighted for its ability to simplify test maintenance and adaptation in response to potential application updates.
Oct 02, 2018
1,261 words in the original blog post.
In the blog post by Matthew Casperson, the distinction between WebDriver and Selenium is clarified within the context of creating a Selenium WebDriver test framework. WebDriver is identified as a low-level HTTP-based API standard for interacting with web browsers, provided by the W3C, and is implemented by most major browsers through separate executable binaries. Selenium, on the other hand, is a higher-level library that simplifies these interactions by wrapping the WebDriver API calls in Java classes and interfaces, making it more practical for developers to write browser-interacting applications. The post explains that while the terms WebDriver, Selenium, and Selenium WebDriver are often used interchangeably, they usually refer to the Selenium API due to its widespread use and practicality over directly employing the WebDriver API. The series aims to guide developers in using Selenium to write WebDriver tests, emphasizing that although the two APIs are not technically identical, they are functionally treated as one in the process of browser automation.
Oct 02, 2018
841 words in the original blog post.
In a blog post from a series about creating a Selenium WebDriver test framework, Matthew Casperson discusses the importance of maximizing browser windows during automated testing to ensure consistent resolution across tests. The post provides a detailed example of implementing a maximizeWindow() method within an AutomatedBrowser class to resolve issues encountered when testing on the Edge browser via BrowserStack. However, the challenges of applying the same approach to mobile browsers like Android, which lack resizable windows, are addressed by overriding the maximizeWindow() method in a BrowserStackAndroidDecorator class to do nothing, thus preventing errors. This approach allows test code to be reusable across different browser types without modification, enhancing maintainability and reducing the need for device-specific code adjustments.
Oct 02, 2018
1,184 words in the original blog post.
Matthew Casperson's blog post from October 2018 outlines the process of setting up a GitHub account and creating a Git repository as part of a series on developing a Selenium WebDriver test framework. It guides users through signing up for a GitHub account, creating a public repository to enable free use of GitHub and Travis CI, and linking this remote repository with a local Git repository using IntelliJ. The post emphasizes the importance of using version control systems like Git for tracking and auditing code changes, as well as the benefits of using hosted Git repositories such as GitHub for code backup, collaboration, and integration with other tools. Additionally, it covers the creation of a .gitignore file to manage which files should be excluded from the repository, and it concludes by describing the process of committing and pushing changes to the GitHub repository, highlighting the advantages of using source control for software development.
Oct 02, 2018
1,214 words in the original blog post.
Matthew Casperson's post from October 2, 2018, explores the development of a Selenium WebDriver test framework, specifically focusing on interacting with a simple web page containing various HTML elements. The article outlines the process of creating a web page with form elements like buttons, text boxes, radio buttons, checkboxes, and select elements, all designed to trigger JavaScript functions that display messages upon interaction. Casperson explains how to save the HTML page in a Maven project directory and how to set up automated browser tests using Java and the WebDriver. He provides a detailed walkthrough of writing a test method that opens and interacts with the web page using WebDriver, including clicking elements, populating text fields, and selecting options, and verifies these interactions by checking the displayed messages. The post emphasizes building a test framework by implementing methods to interact with web elements and verifying the outcomes using assertions, illustrating the core principles of writing WebDriver tests.
Oct 02, 2018
3,352 words in the original blog post.
The article explores the challenges of testing dynamic web elements using Selenium WebDriver, particularly in the context of Single Page Applications (SPAs) that frequently update elements asynchronously. It highlights the limitations of using simple methods like Thread.sleep() to wait for elements to appear, as they are unreliable in real-world applications where element creation is unpredictable. Instead, it emphasizes the use of WebDriver's implicit and explicit waits to handle such scenarios effectively. Implicit waits apply a global timeout for finding elements, while explicit waits allow for more granular control by specifying conditions under which an element should be interacted with, such as ensuring it is clickable. Through examples, the article demonstrates how these waits can be implemented in a test framework, explaining that explicit waits provide more robust and reliable testing solutions by allowing tests to wait for specific states of elements, unlike implicit waits that only check for element presence.
Oct 02, 2018
4,106 words in the original blog post.
Matthew Casperson's article, published on October 2, 2018, explores the creation of a Selenium WebDriver test framework with a focus on generating and utilizing HTTP Archive (HAR) files. These files, which are JSON-formatted logs of a browser's interaction with web applications, can be captured using Chrome developer tools and analyzed with tools like HAR Analyzer to inspect HTTP response codes and network call timings. The article details methods for capturing and saving HAR files using BrowserMob proxy in a test framework, highlighting the implementation of methods such as captureHarFile() and saveHarFile() in the AutomatedBrowser interface and BrowserMobDecorator class. Furthermore, it explains how to capture comprehensive HAR files with additional network data by using captureCompleteHarFile(), which expands the default capture to include headers and cookies. The article emphasizes the importance of HAR files in diagnosing web application errors and understanding performance bottlenecks, and it concludes with a note on the potential for BrowserMob to not only record but also modify network traffic in future posts.
Oct 02, 2018
1,619 words in the original blog post.
Matthew Casperson's blog series, published on October 2, 2018, provides a comprehensive guide on writing WebDriver UI tests in Java, covering everything from initial coding to executing tests at a large scale in the cloud. It explores various components essential to test automation, such as utilizing Maven POM files, identifying web elements through XPaths and CSS selectors, and managing waits effectively. The series delves into advanced topics, including the use of headless browsers, BrowserMob proxy, and techniques for modifying HTTP requests and responses. It also discusses the integration of tools like Git, Travis CI, and BrowserStack, and the implementation of the Page Object Model pattern and Cucumber for test automation. Furthermore, it explains deploying tests using AWS Lambda, creating an UberJAR, and managing environment-specific configurations, ultimately aiming to streamline test processes through serverless architectures and asynchronous execution.
Oct 02, 2018
184 words in the original blog post.
The blog post by Matthew Casperson discusses the challenges and solutions for running Selenium WebDriver tests using a headless Chrome browser within an AWS Lambda environment. Although Lambda is considered serverless, users must still configure the environment every time the application runs, specifically by ensuring the availability of the Chrome browser and binary driver. Due to the non-standard nature of the Linux environment on Lambda, standard Chrome installations are incompatible; instead, a custom build of Chrome is required, which can be automated and obtained from a GitHub repository. Additionally, the Chrome binary driver needs to be configured since standard PATH configurations are restricted on Lambda. To overcome Lambda's package size limitations, additional files like the Chrome distribution and driver are downloaded at runtime from an AWS S3 bucket, leveraging high-speed access due to both Lambda and S3 being hosted by AWS. The post provides instructions for downloading specific versions of Chrome and the driver compatible with Lambda, uploading them to S3, and making them publicly accessible for the testing framework.
Oct 02, 2018
856 words in the original blog post.
The blog post by Matthew Casperson explores the process of configuring a Selenium WebDriver test framework using AWS Lambda and API Gateway to run Gherkin feature files. Initially, tests were triggered through the AWS console, but the post details how to modify the serverless.yml configuration to enable test execution via an HTTP POST request, thus allowing the use of standard HTTP tools like Postman. The configuration involves setting up request and response templates to manage JSON conversion, addressing the API Gateway's 29-second timeout limitation by running the Lambda function asynchronously using the X-Amz-Invocation-Type header set to "Event." This approach allows tests to be executed without waiting for completion, but it also means that test results are not immediately available, necessitating further adjustments to capture and report test outcomes.
Oct 02, 2018
1,624 words in the original blog post.
Matthew Casperson's article outlines the process of integrating Travis CI with a GitHub repository to establish a continuous integration pipeline for a Selenium WebDriver test framework. By signing into Travis CI with GitHub, users can authorize and connect their repositories, allowing Travis CI to monitor the code for any changes. The article details the creation and configuration of a .travis.yml file, which specifies the build environment, including the use of a Linux-based virtual machine and the installation of necessary software such as Oracle JDK and Firefox. The setup involves various commands to prepare the environment, including installing dependencies and configuring Xvfb for headless browser testing. Casperson also addresses how to manage environment variables in Travis CI to avoid sensitive information exposure in logs. Once configured, Travis CI automatically builds and tests the project whenever code is checked into GitHub, ensuring that any issues are promptly identified and resolved, embodying the principles of continuous integration.
Oct 02, 2018
1,891 words in the original blog post.
In this blog post, Matthew Casperson discusses the integration of mobile browser testing into a Selenium WebDriver test framework using BrowserStack, with a focus on testing with Chrome on a Samsung Galaxy Note 8. The article provides a detailed explanation of creating a decorator class, BrowserStackAndroidDecorator, to set the desired capabilities for running tests on mobile devices, and how to use this class within the AutomatedBrowserFactory. Casperson outlines the process of configuring environment variables for BrowserStack credentials within IntelliJ's JUnit settings to streamline the testing process across various devices. The post highlights the flexibility of WebDriver in accommodating a wide range of devices through simple decorators, while also acknowledging the need to address edge cases when testing across different browser environments.
Oct 02, 2018
840 words in the original blog post.
Matthew Casperson's blog post delves into creating a Selenium WebDriver test framework using TicketMonster, a sample application by RedHat, as a real-world testing example. The post walks through the process of automating a ticket purchase for a fictional event, detailing the use of various WebDriver techniques for interacting with dynamic web elements and validating outcomes. It highlights the challenges of working with non-optimized applications and the need for explicit waits due to the absence of unique IDs for elements, necessitating alternative methods like name attributes and CSS selectors for element identification. Additionally, the post emphasizes the importance of capturing HAR files to diagnose network-related issues that might affect user experience, even in successful test runs. Casperson also underscores the value of continuous integration using tools like Travis CI to maintain code integrity and discusses plans to enhance the maintainability of the test framework in future series installments.
Oct 02, 2018
2,535 words in the original blog post.
Ryan Rousseau, a Solution Architect at Octopus, explores the challenges and solutions associated with Octopus's multi-tenancy feature in a SaaS environment, where different versions of the same application are deployed to multiple tenants with distinct configurations. The text discusses a specific scenario involving complex internal naming conventions for environments, which led to difficulties in managing lifecycle processes and project overviews due to the excessive number of environments. To address these issues, the solution involves using Target Roles to tag machines with metadata, allowing the consolidation of deployment targets into generic environments like Dev, Test, and Prod, while maintaining visibility of internal environment names. This approach simplifies the project overview and lifecycle management, reducing friction when adding new tenants, and offers a model that can be applied to other projects without creating separate environments for each.
Oct 01, 2018
987 words in the original blog post.