{"id":36936,"date":"2022-04-21T06:30:00","date_gmt":"2022-04-21T13:30:00","guid":{"rendered":"https:\/\/app14743.cloudwayssites.com\/?p=36936"},"modified":"2022-04-19T13:38:06","modified_gmt":"2022-04-19T20:38:06","slug":"how-to-avoid-split-batches-applitools-parallel-tests","status":"publish","type":"post","link":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/","title":{"rendered":"How to Avoid Split Batches When Running Applitools Tests in Parallel"},"content":{"rendered":"\n<p><em>Parallel testing is a powerful tool you can use to speed up your Applitools tests, but ensuring test batches are grouped together and not split is a common issue. Here\u2019s how to avoid it.<\/em><\/p>\n\n\n\n<p>Visual testing with <a href=\"https:\/\/app14743.cloudwayssites.com\/platform\/eyes\/\">Applitools Eyes<\/a> is an awesome way to supercharge your automated tests with visual checkpoints that catch more problems than traditional assertions. However, just like with any other kind of UI testing, test execution can be slow. The best way to shorten the total start-to-finish time for any automated test is <a href=\"https:\/\/en.wikipedia.org\/wiki\/Parallel_computing\">parallelization<\/a>. <a href=\"https:\/\/app14743.cloudwayssites.com\/platform\/ultrafast-grid\/\">Applitools Ultrafast Grid<\/a> performs ultrafast visual checkpoints concurrently in the cloud, but the functional tests that initially capture those snapshots can also be optimized with parallel execution. Frameworks like JUnit, SpecFlow, pytest, and Mocha all support parallel testing.<\/p>\n\n\n\n<p><strong>If you parallelize your automated test suite in addition to your visual snapshot analysis, then you might need to inject a custom batch ID to group all test results together.<\/strong> What? What\u2019s a batch, and why does it need a special ID? I hit this problem recently while automating visual tests with Playwright. Let me show you the problem with batches for parallel tests, and then I\u2019ll show you the right way to handle it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-parallel-playwright-tests\">Parallel Playwright Tests<\/h2>\n\n\n\n<p>If you haven\u2019t already heard, <a href=\"https:\/\/playwright.dev\/\">Playwright<\/a> is a relatively new web testing framework from Microsoft. I love it because it solves many of the problems with browser automation, like setup, waiting, and network control. Playwright also has implementations in JavaScript\/TypeScript, Python, Java, and C#.<\/p>\n\n\n\n<p>Typically, I program Playwright in Python, but today, I tried TypeScript. I wrote a small automated test suite to test the <a href=\"https:\/\/demo.applitools.com\/tlcHackathonMasterV1.html\">AppliFashion demo web app<\/a>. You can find my code on GitHub here: <a href=\"https:\/\/github.com\/AutomationPanda\/applitools-holiday-hackathon-2020\">https:\/\/github.com\/AutomationPanda\/applitools-holiday-hackathon-2020<\/a>.<\/p>\n\n\n\n<p>The file <a href=\"https:\/\/github.com\/AutomationPanda\/applitools-holiday-hackathon-2020\/blob\/main\/tests\/hooks.ts\"><code>tests\/hooks.ts<\/code><\/a> contains the Applitools setup:<\/p>\n\n\n\n<pre class=\"wp-block-code lang-typescript\"><code>import { test } from '@playwright\/test';\r\nimport { Eyes, VisualGridRunner, Configuration, BatchInfo, BrowserType, DeviceName } from '@applitools\/eyes-playwright';\r\n \r\nexport let Runner: VisualGridRunner;\r\nexport let Batch: BatchInfo;\r\nexport let Config: Configuration;\r\n \r\ntest.beforeAll(async () => {\r\n  Runner = new VisualGridRunner({ testConcurrency: 5 });\r\n  Batch = new BatchInfo({name: 'AppliFashion Tests'});\r\n \r\n  Config = new Configuration();\r\n  Config.setBatch(Batch);\r\n  Config.addBrowser(1200, 800, BrowserType.CHROME);\r\n  Config.addBrowser(1200, 800, BrowserType.FIREFOX);\r\n  Config.addBrowser(1200, 800, BrowserType.EDGE_CHROMIUM);\r\n  Config.addBrowser(1200, 800, BrowserType.SAFARI);\r\n  Config.addDeviceEmulation(DeviceName.iPhone_X);\r\n});\r<\/code><\/pre>\n\n\n\n<p>Before all tests start, it sets up a batch named \u201cAppliFashion Tests\u201d to run the tests against five different browser configurations in the Ultrafast Grid. This is a one-time setup.<\/p>\n\n\n\n<p>Among other pieces, this file also contains a function to build the Applitools Eyes object using <code>Runner<\/code> and <code>Config<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code lang-typescript\"><code>export function buildEyes() {\r\n  return new Eyes(Runner, Config);\r\n}\r<\/code><\/pre>\n\n\n\n<p>The file <a href=\"https:\/\/github.com\/AutomationPanda\/applitools-holiday-hackathon-2020\/blob\/main\/tests\/applifashion.spec.ts\"><code>tests\/applifashion.spec.ts<\/code><\/a> contains three tests, each with visual checks:<\/p>\n\n\n\n<pre class=\"wp-block-code lang-ts\"><code>import { test } from '@playwright\/test';\r\nimport { Eyes, Target } from '@applitools\/eyes-playwright';\r\nimport { buildEyes, getAppliFashionUrl } from '.\/hooks';\r\n \r\ntest.describe('AppliFashion', () => {\r\n  let eyes: Eyes;\r\n  let url: string;\r\n \r\n  test.beforeAll(async () => {\r\n    url = getAppliFashionUrl();\r\n  });\r\n  \r\n  test.beforeEach(async ({ page }) => {\r\n    eyes = buildEyes();\r\n    await page.setViewportSize({width: 1600, height: 1200});\r\n    await page.goto(url);\r\n  });\r\n  \r\n  test('should load the main page', async ({ page }) => {\r\n    await eyes.open(page, 'AppliFashion', '1. Main Page');\r\n    await eyes.check('Main page', Target.window().fully());\r\n    await eyes.close(false);\r\n  });\r\n \r\n  test('should filter by color', async ({ page }) => {\r\n    await eyes.open(page, 'AppliFashion', '2. Filtering');\r\n    await page.locator('id=SPAN__checkmark__107').click();\r\n    await page.locator('id=filterBtn').click();\r\n    await eyes.checkRegionBy('#product_grid', 'Filter by color')\r\n    await eyes.close(false);\r\n  });\r\n  \r\n  test('should show product details', async ({ page }) => {\r\n    await eyes.open(page, 'AppliFashion', '3. Product Page');\r\n    await page.locator('text=\"Appli Air x Night\"').click();\r\n    await page.locator('id=shoe_img').waitFor();\r\n    await eyes.check('Product details', Target.window().fully());\r\n    await eyes.close(false);\r\n  });\r\n \r\n  test.afterEach(async () => {\r\n    await eyes.abort();\r\n  });\r\n});\r<\/code><\/pre>\n\n\n\n<p>By default, Playwright would run these three tests using one \u201cworker,\u201d meaning they would be run serially. We can run them in parallel by adding the following setting to <code>playwright.config.ts<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code lang-ts\"><code>import type { PlaywrightTestConfig } from '@playwright\/test';\r\nimport { devices } from '@playwright\/test';\r\n \r\nconst config: PlaywrightTestConfig = {\r\n  \/\/...\r\n  fullyParallel: true,\r\n  \/\/...\r\n};\r\n \r\nexport default config;\r<\/code><\/pre>\n\n\n\n<p>Now, Playwright will use one worker per processor or core on the machine running tests (unless you explicitly set the number of workers otherwise).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-split-batches\">Split Batches<\/h2>\n\n\n\n<p>We can run these tests using the command <code>npm test<\/code>. (Available scripts can be found under <code>package.json<\/code>.) On my machine, they ran (and passed) with three workers. When we look at the visual checkpoints in the Applitools dashboard, we\u2019d expect to see all results in one <a href=\"https:\/\/help.applitools.com\/hc\/en-us\/articles\/360006914772-Batching\">batch<\/a>. However, we see this instead:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"1152\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-Three-Batches.jpg\" alt=\"\" class=\"wp-image-36939\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-Three-Batches.jpg 1600w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-Three-Batches-300x216.jpg 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-Three-Batches-1024x737.jpg 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-Three-Batches-768x553.jpg 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-Three-Batches-1536x1106.jpg 1536w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><figcaption><em>The Applitools dashboard with one batch split into three parts due to Playwright\u2019s parallel execution.<\/em><\/figcaption><\/figure>\n\n\n\n<p>What in the world? There are three batches, one for each worker! All the results are there, but split batches will make it difficult to find all results, especially for large test suites. Imagine if this project had 300 or 3000 tests instead of only 3.<\/p>\n\n\n\n<p>The docs on <a href=\"https:\/\/playwright.dev\/docs\/test-parallel#parallelize-tests-in-a-single-file\">how Playwright Test handles parallel testing<\/a> make it clear why the batch is split into three parts:&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Note that parallel tests are executed in separate worker processes and <strong>cannot share any state or global variables<\/strong>.<\/p><p>Each test executes all relevant hooks just for itself, including beforeAll and afterAll.<\/p><\/blockquote>\n\n\n\n<p>So, each worker process essentially has its own \u201ccopy\u201d of the automation objects. The <code>BatchInfo<\/code> object is not shared between these tests, which causes there to be three separate batches.<\/p>\n\n\n\n<p>Unfortunately, batch splits are a common problem for parallel testing. I hit this problem with Playwright, but I\u2019m sure it happens with other test frameworks, too.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-sharing-a-unique-batch-id\">Sharing a Unique Batch ID<\/h2>\n\n\n\n<p>Thankfully, there\u2019s an easy way to fix this problem: <strong>share a unique batch ID between all concurrent tests<\/strong>. Every batch has an ID. According to the docs, there are <a href=\"https:\/\/app14743.cloudwayssites.com\/docs\/api\/eyes-sdk\/classes-gen\/class_batchinfo\/method-batchinfo-setid-playwright-javascript.html\">three ways to set this ID<\/a>:<\/p>\n\n\n\n<ol><li>Explicitly set it on a <code>BatchInfo<\/code> object.<\/li><li>Set it using the <code>APPLITOOLS_BATCH_ID<\/code> environment variable.<\/li><li>Don\u2019t specify it, and let the system automatically generate a random ID.<\/li><\/ol>\n\n\n\n<p>My original code fell to option 3: I didn\u2019t specify a batch ID, so each worker created its own <code>BatchInfo<\/code> object with its own automatically generated ID. That\u2019s why my test results were split into three batches.<\/p>\n\n\n\n<p>Option 1 is the easiest solution. We could hardcode a batch ID like this:<\/p>\n\n\n\n<pre class=\"wp-block-code lang-ts\"><code>Batch = new BatchInfo({name: 'AppliFashion Tests', id: 'applifashion'});<\/code><\/pre>\n\n\n\n<p>However, <strong>hardcoding IDs is not a good solution<\/strong>. This ID would be used for <em>every<\/em> batch this test suite ever runs. Applitools has features to automatically close batches, but if separate batches run too close together, then they could collide on this common ID and be reported as one batch. Ideally, each batch should have a unique ID. Unfortunately, we cannot generate a unique ID within Playwright code because objects cannot be shared across workers.<\/p>\n\n\n\n<p>Therefore, option 2 is the best solution. Wecould set the <code>APPLITOOLS_BATCH_ID<\/code> environment variable to a unique ID before each test run. For example, on macOS or Linux, we could use the <code>uuidgen<\/code> command to generate UUIDs like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>APPLITOOLS_BATCH_ID=$(uuidgen) npm test<\/code><\/pre>\n\n\n\n<p>The ID doesn\u2019t need to be a UUID. It could be any string, like a timestamp. However, UUIDs are recommended because the chances of generating duplicate IDs is near-zero. Timestamps are more likely to have collisions. (If you\u2019re on Windows, then you\u2019ll need to come up with a different command for generating unique IDs than the one shown above.)<\/p>\n\n\n\n<p>Now, when I run my test with this injected batch ID, all visual test results fall under one big batch:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"1152\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-One-Batch.jpg\" alt=\"\" class=\"wp-image-36942\" srcset=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-One-Batch.jpg 1600w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-One-Batch-300x216.jpg 300w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-One-Batch-1024x737.jpg 1024w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-One-Batch-768x553.jpg 768w, https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/Applitools-Dashboard-with-One-Batch-1536x1106.jpg 1536w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><figcaption>The Applitools dashboard with one batch for all results under a shared batch ID, despite running on different Playwright workers.<\/figcaption><\/figure>\n\n\n\n<p>That\u2019s the way it should be! Much better.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>I always recommend setting a concise, informative batch name for your visual tests. Setting a batch ID, however, is something you should do only when necessary \u2013 such as when tests run concurrently. If you run your tests in parallel and you see split batches, give the <code>APPLITOOLS_BATCH_ID<\/code> environment variable a try!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Parallel testing is a powerful tool you can use to speed up your Applitools tests. Here\u2019s how to avoid a common batching issue while using it.<\/p>\n","protected":false},"author":89,"featured_media":36943,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10004],"tags":[16717,16608,12690,16676,10821,12686],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.5 (Yoast SEO v24.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Avoid Split Batches When Running Applitools Tests in Parallel - AI-Powered End-to-End Testing | Applitools<\/title>\n<meta name=\"description\" content=\"Parallel testing is a powerful tool you can use to speed up your Applitools tests. Here\u2019s how to avoid a common batching issue while using it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Avoid Split Batches When Running Applitools Tests in Parallel\" \/>\n<meta property=\"og:description\" content=\"Parallel testing is a powerful tool you can use to speed up your Applitools tests. Here\u2019s how to avoid a common batching issue while using it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/\" \/>\n<meta property=\"og:site_name\" content=\"AI-Powered End-to-End Testing | Applitools\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-21T13:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"842\" \/>\n\t<meta property=\"og:image:height\" content=\"531\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andrew Knight\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrew Knight\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/\"},\"author\":{\"name\":\"Andrew Knight\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a8038d2c9ccd3531090422b6172b125b\"},\"headline\":\"How to Avoid Split Batches When Running Applitools Tests in Parallel\",\"datePublished\":\"2022-04-21T13:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/\"},\"wordCount\":1024,\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg\",\"keywords\":[\"parallel testing\",\"Playwright\",\"Test Engineers\",\"Tips\",\"Tutorial\",\"Visual Testing Strategies\"],\"articleSection\":[\"Advanced Topics\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/\",\"name\":\"How to Avoid Split Batches When Running Applitools Tests in Parallel - AI-Powered End-to-End Testing | Applitools\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg\",\"datePublished\":\"2022-04-21T13:30:00+00:00\",\"description\":\"Parallel testing is a powerful tool you can use to speed up your Applitools tests. Here\u2019s how to avoid a common batching issue while using it.\",\"breadcrumb\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#primaryimage\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg\",\"width\":842,\"height\":531},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advanced Topics\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/blog\/category\/advanced-topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Avoid Split Batches When Running Applitools Tests in Parallel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"name\":\"Applitools Visual AI\",\"description\":\"Applitools delivers full end-to-end test automation with AI infused at every step.\",\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\",\"name\":\"Applitools\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"width\":156,\"height\":28,\"caption\":\"Applitools\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a8038d2c9ccd3531090422b6172b125b\",\"name\":\"Andrew Knight\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a1117da4074b1fd8692051ab8a3a9528?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a1117da4074b1fd8692051ab8a3a9528?s=96&d=mm&r=g\",\"caption\":\"Andrew Knight\"},\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/author\/andyknight\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Avoid Split Batches When Running Applitools Tests in Parallel - AI-Powered End-to-End Testing | Applitools","description":"Parallel testing is a powerful tool you can use to speed up your Applitools tests. Here\u2019s how to avoid a common batching issue while using it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/","og_locale":"en_US","og_type":"article","og_title":"How to Avoid Split Batches When Running Applitools Tests in Parallel","og_description":"Parallel testing is a powerful tool you can use to speed up your Applitools tests. Here\u2019s how to avoid a common batching issue while using it.","og_url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/","og_site_name":"AI-Powered End-to-End Testing | Applitools","article_published_time":"2022-04-21T13:30:00+00:00","og_image":[{"width":842,"height":531,"url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg","type":"image\/jpeg"}],"author":"Andrew Knight","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andrew Knight","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#article","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/"},"author":{"name":"Andrew Knight","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a8038d2c9ccd3531090422b6172b125b"},"headline":"How to Avoid Split Batches When Running Applitools Tests in Parallel","datePublished":"2022-04-21T13:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/"},"wordCount":1024,"publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg","keywords":["parallel testing","Playwright","Test Engineers","Tips","Tutorial","Visual Testing Strategies"],"articleSection":["Advanced Topics"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/","url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/","name":"How to Avoid Split Batches When Running Applitools Tests in Parallel - AI-Powered End-to-End Testing | Applitools","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#primaryimage"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg","datePublished":"2022-04-21T13:30:00+00:00","description":"Parallel testing is a powerful tool you can use to speed up your Applitools tests. Here\u2019s how to avoid a common batching issue while using it.","breadcrumb":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#primaryimage","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2022\/04\/How-to-Avoid-Split-Batches-When-Running-Applitools-Tests-in-Parallel_842x531.jpg","width":842,"height":531},{"@type":"BreadcrumbList","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-avoid-split-batches-applitools-parallel-tests\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/app14743.cloudwayssites.com\/"},{"@type":"ListItem","position":2,"name":"Advanced Topics","item":"https:\/\/app14743.cloudwayssites.com\/blog\/category\/advanced-topics\/"},{"@type":"ListItem","position":3,"name":"How to Avoid Split Batches When Running Applitools Tests in Parallel"}]},{"@type":"WebSite","@id":"https:\/\/app14743.cloudwayssites.com\/#website","url":"https:\/\/app14743.cloudwayssites.com\/","name":"Applitools Visual AI","description":"Applitools delivers full end-to-end test automation with AI infused at every step.","publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/app14743.cloudwayssites.com\/#organization","name":"Applitools","url":"https:\/\/app14743.cloudwayssites.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","width":156,"height":28,"caption":"Applitools"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a8038d2c9ccd3531090422b6172b125b","name":"Andrew Knight","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a1117da4074b1fd8692051ab8a3a9528?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a1117da4074b1fd8692051ab8a3a9528?s=96&d=mm&r=g","caption":"Andrew Knight"},"url":"https:\/\/app14743.cloudwayssites.com\/blog\/author\/andyknight\/"}]}},"_links":{"self":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/36936"}],"collection":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/users\/89"}],"replies":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/comments?post=36936"}],"version-history":[{"count":0,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/36936\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media\/36943"}],"wp:attachment":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media?parent=36936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/categories?post=36936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/tags?post=36936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}