Home / Companies / TestMu AI / Blog / July 2021

July 2021 Summaries

14 posts from TestMu AI

Filter
Month: Year:
Post Summaries Back to Blog
Variables in CSS are used to store values that can be reused throughout the stylesheet. They help reduce redundancy and make the code more maintainable. In this guide, we will learn how to use variables in CSS from its implementation to responsiveness test. SUMMARY: 1. Introduction To Variables In CSS 2. Implementing Variables In CSS 3. Scopes Of Variables In CSS 4. Precedence And Inheritance In Variables In CSS 5. Fallback Values In CSS Variables 6. Exceptions In CSS Variables 7. Browser Compatibility Of CSS Variables 8. Responsiveness Test Of Variables In CSS SUMMARY: 1. Introduction To Variables In CSS Variables in CSS are used to store values that can be reused throughout the stylesheet. They help reduce redundancy and make the code more maintainable. In this guide, we will learn how to use variables in CSS from its implementation to responsiveness test. 2. Implementing Variables In CSS To implement a variable in CSS, first, give the variable a name, then add two hyphens (--) as a prefix. The syntax for declaring a variable in CSS is var(--name, value). For example: :root { --my_variable: <value>; } In this code, we have declared a variable named "my_variable" with the value "<value>" under the root pseudo class. The scope of this variable will be throughout the document from its declaration point. 3. Scopes Of Variables In CSS The scope property is akin to a variable’s scope in the programming languages. The CSS variable’s scope is no different. This is how you can define a CSS variable under two scopes: Global Scope – One declaration For All The scope property is akin to a variable’s scope in the programming languages. The CSS variable’s scope is no different. This is how you can define a CSS variable under two scopes: Local Scope – Bounded By Selector Walls 4. Precedence And Inheritance In Variables In CSS Now we know that when a variable is defined with a global scope, its existence is defined in the complete document from the time of its declaration. But other programming languages like Python or C++ have an open field between functions where you have the option to define the global scope. 5. Fallback Values In CSS Variables The fallback values are the second argument used in the “var()” function, which denotes the substitution of a CSS variable. Fallback values take their name from the job they do – they are used when you fall back with the original variable values. 6. Exceptions In CSS Variables Once you know how to use variables in CSS, you will see it is flexible and easy to use. However, they do have a few exceptions that one should remember before declaring and substituting the variables. 7. Browser Compatibility Of CSS Variables CSS variables enjoy great support from every major browser. If you know how to use variables in CSS, you can ensure that exceptions and fallbacks are correctly working as per the code. 8. Responsiveness Test Of Variables In CSS The most buzzed word of the web development world currently is responsiveness. With Google specifying the responsiveness wherever possible and multiple devices flooding the market, responsive web design has become a priority in itself. Variables in CSS are not visual elements that can be tested with window resize functionality for responsiveness. But they do affect the components that are visual such as div, images, or anything else. Therefore, responsiveness test is important with the CSS media queries whether variables in CSS support them or not.
Jul 29, 2021 5,030 words in the original blog post.
Cookies are small packets of data sent from websites and stored on your computer. They help track user activity and preferences across multiple sessions. In the context of Selenium WebDriver, handling cookies can be crucial in automation testing projects for performing cookie-related operations. Selenium provides built-in methods to interact with cookies, such as getting all cookies, retrieving a specific cookie, adding a new cookie, deleting a specific cookie, and deleting all cookies. These methods are part of the org.openqa.selenium.Cookie package in Java.
Jul 28, 2021 2,370 words in the original blog post.
This blog discusses how to run JUnit tests using TestNG in Selenium without any re-work in writing the tests. Both JUnit and TestNG are popular unit testing frameworks that have been widely accepted by Java developers. The major push for this cross-pollination is the extensive set of features provided by the TestNG framework. To run test cases using JUnit and TestNG in Selenium, you can leverage the built-in support for running JUnit tests in TestNG through the JUnit tag in the XML file. This allows users to harness the capabilities of TestNG while still utilizing their existing test cases written in JUnit.
Jul 27, 2021 3,289 words in the original blog post.
This article discusses best practices for JavaScript testing to ensure scalable and reliable automated test scenarios. It covers topics such as behavioral testing, unit testing, shift-left testing, portability of test automation frameworks, logical test naming, BDD approach, avoiding unnecessary mocking, efficient cross-browser testing, creating a test management suite, complying with data privacy regulations, and minimizing the use of helpers. The article emphasizes the importance of understanding when to stop testing and how to maintain tests in Selenium.
Jul 26, 2021 3,339 words in the original blog post.
Sure, here's how you can use JaCoCo Maven Plugin for code coverage in a Java project with Maven: 1. Adding Dependency to POM.xml file: Firstly, add the dependency of JaCoCo Maven plugin to your POM.xml file. The POM.xml file is located at the root directory of your project. Here's how you can do it: ```xml <dependencies> <!-- Adding JaCoCo Maven Plugin Dependency --> <dependency> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.6</version> </dependency> </dependencies> ``` 2. Configuring JaCoCo Maven Plugin: Next, configure the JaCoCo Maven plugin in your POM.xml file. You can do this by adding a new <plugin> tag inside the <build> tag of your POM.xml file. Here's how you can do it: ```xml <plugins> <!-- Adding JaCoCo Maven Plugin Configuration --> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.6</version> <executions> <!-- Execution to generate JaCoCo coverage report --> <execution> <id>preparation-agent</id> <goals> <goal>prepare-agent</goal> </goals> </execution> <!-- Execution to run the test cases --> <execution> <id>run-tests</id> <phase>test</phase> <goals> <goal>test</goal> </goals> </execution> <!-- Execution to publish the JaCoCo coverage report --> <execution> <id>report</id> <phase>verify</phase> <goals> <goal>report</goal> </goals> </execution> </executions> </plugin> </plugins> ``` 3. Running the Maven Jobs: Now, run the maven jacoco:preparation-agent to prepare the JaCoCo agent for code coverage tracking. You can do this by running the following command in your terminal or command prompt: ```bash mvn jacoco:prepare-agent ``` 4. Running the Test Cases: Next, run the test cases of your project. This will generate a new JaCoCo coverage report. You can do this by running the following command in your terminal or command prompt: ```bash mvn test ``` 5. Generating Code Coverage Report: Finally, run the maven jacoco:report to publish a new coverage report. JaCo offers a simple and easy way to track code coverage score by declaring minimum requirements. Build fails if these requirements are not met else the build is successful. These requirements can be specified as rules in POM.xml. Just specify the new execution specifying ‘check’ goal in POM.xml. Add the below code after the second <execution> tag in POM.xml. <!--Third execution : used to put a check on the entire package--> <execution> <id>jacoco-check</id> <goals> <goal>check</goal> </goals> <configuration> <rules> <rule> <element>PACKAGE</element> <limits> <limit> <counter>LINE</counter> <value>COVEREDRATIO</value> <minimum>0.50</minimum> </limit> </limits> </rule> </rules> </configuration> </execution> 123456789101112131415161718192021222324252627282930313233343536373839404142434454647484950515253545565758596061626364656676869707172737475767778 With this, we are limiting our coverage ratio to 50%. This signifies a minimum of 50% of the code should be covered during the test phase. You can run maven clean verify to check whether the rules set in jacoco:check goal are met or not. The log shows “All coverage checks have been met.” as our code coverage score is 94% which is greater than our minimum 50%. Automation Testing On LambdaTest Selenium Grid using Maven Project with Jacoco Plugin Selenium testing on the cloud helps you attain better browser coverage, increased test coverage, and accelerated time to market. Parallel testing in Selenium helps you achieve the above mentioned requirements. LambdaTest Cloud Selenium Grid is a cloud-based scalable Selenium testing platform that enables you to run your automation scripts on 2000+ different browsers and operating systems. Pre-requisites: To run the test script using JUnit with Selenium, first, we need to set up an environment. You would first need to create an account on LambdaTest. Do make a note of the username and access-key that is available in LambdaTest profile section. We will use this sample project for Java Selenium testing. Importing project to Eclipse IDE: After downloading a zip file of the project: junit-selenium-sample from GitHub, we import it to Eclipse IDE by following the below mentioned steps: Go to your Eclipse IDE, click on the File menu and select Import. A new dialog box appears. Type Maven in the textbox below and select Existing Maven Projects, and then click Next. In the next dialog box, click on Browse and traverse to the project folder. Also, tick the checkbox giving the path to the POM.xml file, and click Finish. Your project will be loaded in Eclipse IDE successfully. Adding dependencies in the POM.xml file: Open the POM.xml, now add the dependencies of JUnit, Selenium, and JaCoCo Maven Plugin. After adding the dependencies to the code of POM.xml should look like this: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
Jul 23, 2021 5,014 words in the original blog post.
CSS breakpoints are crucial for creating responsive designs that provide an exceptional user experience across different device viewports or screen sizes. They help in splitting the design into smaller versions of a website based on the device's screen size, ensuring smooth navigation and readable content. CSS media query breakpoints can be set using min-width, max-width, or a combination of both. It is recommended to use relative units like ems or percentages instead of absolute units like pixels for better responsiveness. The common breakpoints are 320px for mobile devices, 481px for iPads and tablets, 769px for small screens, 1025px for large screens, and 1201px for extra-large screens.
Jul 20, 2021 2,548 words in the original blog post.
This comprehensive XPath cheat sheet covers the different types of XPath in Selenium, including absolute and relative paths, syntax, selectors, operators, functions, and more. It provides examples for each concept and can be used as a handy resource when performing Selenium automation testing. The cheat sheet also includes information on how to use JQuery to obtain XPath and how to validate XPath using browser consoles.
Jul 19, 2021 3,154 words in the original blog post.
This tutorial covers the basics of Python read config file using Selenium, including configuration file formats such as JSON, YAML, INI, and XML, and how to use them in Python tests. The tutorial also shows how to create a configuration file for storing essential parameters, including username and access key for using the LambdaTest Selenium Grid, and how to pass it as a command-line argument or define it directly in the code.
Jul 16, 2021 2,799 words in the original blog post.
Responsive web design has become a crucial aspect of modern web development due to the proliferation of mobile devices and changing user behavior. As John Allsopp noted, "accept the ebb and flow of things," and responsive design has emerged as a flexible and adaptive approach to cater to various screen sizes and devices. With over 3.6 billion smartphone users globally, businesses must prioritize responsive web design to ensure a seamless user experience across all platforms. The benefits of responsive web design include improved user experience, cost-effectiveness, reduced bounce rates and session timing, and easier maintenance efforts. However, it is not a one-size-fits-all solution and may not be necessary for every business or project. Alternatives like dynamic rendering and separate mobile websites can also be considered in certain cases. To test website responsiveness, various tools such as browser developer tools, LT Browser, and mobile-friendly checker tools can be utilized to ensure a smooth user experience across all devices.
Jul 15, 2021 2,618 words in the original blog post.
:` CSS Animations are an excellent way to create visual animations that are not restricted to a single motion like CSS Transitions but are far more developed. With the introduction of CSS Animations, developers thought of introducing them to their library as CSS Animations. Animation can bring creativity, enthusiasm, grab the user’s attention, convey things quickly, and improve usability. Recently, there has been a rise in the use of animation on websites and web apps. The transform property in CSS animations makes transformations to the size (rescaling), moving them (translating), rotating them (rotations), or skewing them on the web page. The transition feature in CSS comprises of four properties: transition-property, transition-duration, transition-timing-function, and transition-delay. The animation-name property defines the name of the animation that is required to be attached to the object. Multiple animations can be used with comma-separated values. The browser support for CSS Animation property is great and all the versions of all the browsers support every sub-property.
Jul 08, 2021 4,200 words in the original blog post.
LambdaTest has made several updates in June, including live Cypress testing, free LT Browser for lifetime, integration with YouTrack, added browsers and devices, real-time testing, screenshot testing, automation testing, enhanced automation dashboard, geolocation testing, and new features.
Jul 06, 2021 1,101 words in the original blog post.
The SpecFlow framework is a Behavior-Driven Development (BDD) tool that allows for effective communication and collaboration between software developers, product owners, and stakeholders. It enables teams to write test scenarios in simple English language, reducing the complexity of software testing. The framework is open-source and free to use, with features such as separation of specifications and test automation, focus on coding feature-logic instead of explaining it to stakeholders, and integration with tools like LambdaTest and Selenium for a customized BDD experience. SpecFlow can help teams achieve improved product quality by reducing the communication gap between stakeholders and enabling collaboration around shared business goals, functionality, and acceptance criteria.
Jul 05, 2021 1,152 words in the original blog post.
CircleCI is an automated testing pipeline tool that integrates well with popular version control systems like Github and provides a simple interface for multiple libraries. It automates build, tests, and deployment processes, making it ideal for agile development environments. CircleCI also supports automation of repetitive processes through orbs, which are reusable packages in YAML format. These orbs provide seamless integration with third-party tools and can be used to create custom workflows. The tool provides a modern CI cloud server that is best-suited for teams looking to automate their testing processes at scale. By integrating CircleCI with Cloud Selenium Grid and LambdaTest, organizations can perform automation testing on a large scale, making the quality assurance process faster, more efficient, and time-effective.
Jul 02, 2021 3,760 words in the original blog post.
Cypress is a web application testing framework for Node.js that makes it easier to write end-to-end tests for your applications, solving the problem that most frameworks do not support end-to-end testing and providing an intuitive command-line interface. It does not use Selenium but can be used with it, offering more power and making tests easier to read and write. Cypress automation framework is designed to be painless and easy to use, allowing developers to write new tests from scratch using its domain-specific language. The framework generates code that runs natively in the browser, making tests run faster. It also provides features such as parallel testing online with LambdaTest, cross-browser testing, and integration with CI tools, offering a reliable automation cloud testing framework for modern UI frameworks and applications built with component-based test support. Cypress has gained popularity due to its benefits, including easy setup, in-built wait for requests feature, no need for driver binaries, convenient reporting, intuitive dashboard experience, and more. The framework is widely accepted by the developer community and has a huge following since its public release for the community. With Cypress, developers can change code and execute it on the fly, providing detailed documentation and a thriving community.
Jul 01, 2021 2,698 words in the original blog post.