{"id":192966,"date":"2019-12-26T11:00:37","date_gmt":"2019-12-26T19:00:37","guid":{"rendered":"http:\/\/developer.salesforce.com\/blogs\/?p=192966"},"modified":"2025-11-05T02:21:14","modified_gmt":"2025-11-05T09:21:14","slug":"automated-testing-of-global-search-in-lightning-ui","status":"publish","type":"post","link":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui","title":{"rendered":"Automated Testing of Global Search in Lightning UI"},"content":{"rendered":"<p>We are excited to kick off a series of posts on Selenium WebDriver-based test automation best practices and tips for test engineers who are developing or maintaining test automation for Salesforce applications. Lightning Experience continues to evolve with modern web standards, and that evolution can have unintended impact on Selenium-based tests. Our posts will provide measures to deal with the changes introduced by the new web technologies.<\/p>\n<blockquote><p>Not familiar with Selenium WebDriver? It is the <a href=\"https:\/\/www.w3.org\/TR\/webdriver\/\">de-facto standard<\/a> open-source-tool for testing web applications like the Salesforce app. Learn more about Selenium WebDriver on <a href=\"https:\/\/selenium.dev\/\">its home page<\/a> or <a href=\"https:\/\/en.wikipedia.org\/wiki\/Selenium_(software)\">this Wikipedia article<\/a>. This <a href=\"https:\/\/github.com\/SeleniumHQ\/selenium\/wiki\/Getting-Started\">5 Minute Getting Started Guide<\/a> leads you through the first steps to run tests automatically. In June 2013 the tool was also the topic of this <a href=\"https:\/\/developer.salesforce.com\/blogs\/engineering\/2013\/06\/automated-testing-using-selenium-at-salesforce.html\">Salesforce Developer blog post<\/a>.<\/p><\/blockquote>\n<p>In this first post, we cover automation of the global search field in the Lightning UI. The global search field is one of the most popular features used by end users, and many automated UI test cases will need to implement steps that work with this UI element. We\u2019ll start with a simple query and then move to more complicated settings \u2014 the use of categories for restricting the search and how to make the use of categories dynamic. By following the steps here, you will be able to automate these tasks in a fast yet robust way.<\/p>\n<h3>Task 1: Enter a search term in the global search field and start the search<\/h3>\n<p>Here is a very simple, straight-forward implementation, assuming you have to test the UI in one language only and that would be English:<\/p>\n<pre>01 WebElement inputBox = wd.findElement(By.xpath(\"\/\/input[@title='Search Salesforce']\"));\r\n02 inputBox.click();\r\n03 inputBox.clear();\r\n04 inputBox.sendKeys(\"CS88 Corp\");\r\n05 inputBox.click();\r\n06 wd.findElement(By.xpath(\"\/\/span[@title='CS88 Corp']\"));\r\n07 inputBox.sendKeys(Keys.RETURN);\r\n08 wd.findElement(By.xpath(\"\/\/a[@title='CS88 Corp']\"));<\/pre>\n<p>Line-by-line:<\/p>\n<ol>\n<li>Line 1: If you are covering only a single UI user language, then searching for an element by using a UI text is the most simple differentiator. If you need to cover multiple languages, you could perhaps get the correct text from a dictionary. See the line-by-line description for Task 2 below for what the approach could look like.<\/li>\n<li>Line 2: This click sets the cursor in the search box.<\/li>\n<li>Line 3: Remove any previously entered text.<\/li>\n<li>Line 4: Insert the search term of your choice.<\/li>\n<li>Line 5: This click kicks off the search.<\/li>\n<li>Line 6: Using findElement() is an easy way to assert that an element is present. If not, Selenium will throw a proper exception and your test will fail in a way you can easily triage the problem. Here we assert that the list of most recently used records is listing the record we are looking for.<\/li>\n<li>Line 7: Sending a Return keystroke will finally kick off the search.<\/li>\n<li>Line 8: Verify that the search returned the expected record.<\/li>\n<\/ol>\n<p>You may have noticed that this code works without a single Thread.sleep() call! Why? Because WebDriver does a lot of things under-the-hood to ensure stable test execution. We will have more on this in a future post.<\/p>\n<p>Is this the only way to implement testing the global search field? No, it\u2019s not. However, it is an approach which is both simple and robust.<\/p>\n<h3>Task 2: Select a category for filtering before entering a search term in the global search field<\/h3>\n<p>For clarification purposes, this picture shows where you can set a category for filtering the search result:<\/p>\n<p>\n\t\t\t  <span class=\"postimagessection_specify aligncenter\" >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/20191219161407\/Global-Search-Field-Task-2-Select-category-Account.png\" class=\"postimages\" width=\"724\" height=\"398\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\t<br \/>\nThis code example builds on the above example:<\/p>\n<pre>01 WebElement inputBox = wd.findElement(By.xpath(\"\/\/input[@title='\" + getSearchHint() + \"']\"));\r\n02 WebElement categoryHome = wd.findElement(By.xpath(\"\/\/input[@id='input-5']\"));\r\n03 categoryHome.click();\r\n04 wd.findElement(By.xpath(\"\/\/lightning-base-combobox-item[@id='input-5-1-5']\")).click();\r\n05 inputBox = wd.findElement(By.xpath(\"\/\/input[@title='Search \" + getSearchHintForAccounts() + \"']\"));\r\n06 inputBox.click();\r\n07 inputBox.clear();\r\n08 inputBox.sendKeys(\"CS88 Corp\");\r\n09 inputBox.click();\r\n10 wd.findElement(By.xpath(\"\/\/span[@title='CS88 Corp']\"));\r\n11 inputBox.sendKeys(Keys.RETURN);\r\n12 wd.findElement(By.xpath(\"\/\/a[@title='CS88 Corp']\"));<\/pre>\n<p>Line-by-line unless covered in Task 1:<\/p>\n<ol>\n<li>Line 1: This assumes getSearchHint() gets you the right text from a dictionary which is based on UI user language setting. I leave the implementation of getSearchHint() up to you.<\/li>\n<li>Line 2: This is the input field directly on the left side of the global search box. The use of By.xpath instead of <a href=\"http:\/\/By.id\">By.id<\/a> is intentional and is because of Lighting Web Components (LWC). We will have more on this in a later post.<\/li>\n<li>Line 3: A click in that input field expands the list of categories the user can choose from.<\/li>\n<li>Line 4: Finding any entry in the list is actually quite tricky, because a right-mouse click on it to inspect in your browser\u2019s developer console makes the list vanish without updating the console. However, once you have expanded the list and are inspecting the input field in the console, you will find an attribute of type \u201caria-activedescendant\u201d. This <a href=\"https:\/\/youtu.be\/iG61dv4TUtw\" target=\"_blank\" rel=\"noopener noreferrer\">short video<\/a> shows how.<\/li>\n<li>Line 5: Now that a filter is established, the selector for the input box needs an update. If your user language setting is English, the <b>title<\/b> attribute needs to have the value \u201cSearch Accounts\u201d. Similar to line 1, we call a dictionary to get right text based on the UI user language setting.<\/li>\n<li>Lines 6-12: See comments for lines 2-8 for Task 1.<\/li>\n<\/ol>\n<p>As mentioned above, this too is technically, still pretty simple, don\u2019t you agree? The exception is of course figuring out how to get to the right element in the list of categories. In the next example we will explore how to use an arbitrary category name.<\/p>\n<h3>Task 3: Select a category by name for filtering<\/h3>\n<p>This code example is a variation of the above example:<\/p>\n<pre>01 WebElement inputBox = wd.findElement(By.xpath(\"\/\/input[@title='\" + getSearchHint() + \"']\"));\r\n02 WebElement categoryHome = wd.findElement(By.xpath(\"\/\/input[@id='input-5']\"));\r\n03 categoryHome.click();\r\n04 wd.findElement(By.xpath(\"\/\/lightning-base-combobox-item[@data-value='FILTER:Account:Accounts']\")).click();\r\n05 inputBox = wd.findElement(By.xpath(\"\/\/input[@title='Search \" + getSearchHintForAccounts() + \"']\"));\r\n06 inputBox.click();\r\n07 inputBox.clear();\r\n08 inputBox.sendKeys(\"CS88 Corp\");\r\n09 inputBox.click();\r\n10 wd.findElement(By.xpath(\"\/\/span[@title='CS88 Corp']\"));\r\n11 inputBox.sendKeys(Keys.RETURN);\r\n12 sleep(1000L);\r\n13 wd.findElement(By.xpath(\"\/\/a[@title='CS88 Corp']\"));<\/pre>\n<p>Line-by-line unless covered in Task 2:<\/p>\n<ol>\n<li>Lines 1-3. See comments for same lines for Task 2<\/li>\n<li>Line 4. The interesting part here is the value of the attribute <b>data-value<\/b>. It is a concatenation of the object\u2019s API name in its singular form (\u201cAccount\u201d) and its plural form (\u201cAccounts\u201d) as defined in Setup. Hence this value will be the same even if using a different UI user language.<\/li>\n<li>Line 5-11. See comments for same lines for Task 2.<\/li>\n<li>Line 12. This is one of the rare examples where a Thread.sleep() call is actually required! We need to wait for the page to display the list of records found. If you leave the call out, the UI sometimes opens the record right away and the command on the next line will fail. We will have more on judicious uses of Thread.sleep() in a future post.<\/li>\n<li>Line 13. See comments for line 12 for Task 2.<\/li>\n<\/ol>\n<p>The examples in this post show how to:<\/p>\n<ul>\n<li>Write a test in a simple, yet robust way.<\/li>\n<li>Get information on an UI element from the browser\u2019s dev console, even if direct inspection is not possible.<\/li>\n<\/ul>\n<p>You also had a glimpse into what it means to test engineers if UI elements are now based on Lightning Web Components (LWC). At time index 0:05 of the video above, the mouse hovers over a node called <i>#shadow-root (user-agent)<\/i>. This indicates that the UI element has been ported over to LWC. We will have more on the changes that are introduced to the DOM by the LWC rollout that negatively impact automated UI tests in future posts.<\/p>\n<p>What challenges are you facing as a test engineer? Do you have any topics you would like to suggest for a future post? Please let us know by leaving a comment below. We are interested in hearing from you.<\/p>\n<h2>About the author<\/h2>\n<p>Georg Neumann is intimately familiar with Selenium since version 1. He is part of the Salesforce Central QE team, which is using Selenium tests written by Salesforce customers to test their own Salesforce implementation to find regressions introduced by Salesforce in a new release before they affect the customers. This service is called Business Scenario Testing (BST) and open to any Salesforce customers meeting the requirements for participation. Follow him on <a href=\"https:\/\/www.linkedin.com\/in\/georgneumann\/\">LinkedIn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to kick off a series of posts on Selenium WebDriver-based test automation best practices and tips for test engineers who are developing or maintaining test automation for Salesforce applications. Lightning Experience continues to evolve with modern web standards, and that evolution can have unintended impact on Selenium-based tests. Our posts will provide [&hellip;]<\/p>\n","protected":false},"author":3540,"featured_media":189449,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2770,2766],"tags":[2668,2672,2671,1271,2684],"coauthors":[],"class_list":["post-192966","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-automation","category-tutorials","tag-december-2019","tag-global-search","tag-lightning-ui","tag-selenium","tag-test-automation"],"podcast_audio":{"audio_url":"","duration":""},"featured_image":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png?w=200","related_posts":[],"unstyled_content":"<p>We are excited to kick off a series of posts on Selenium WebDriver-based test automation best practices and tips for test engineers who are developing or maintaining test automation for Salesforce applications. Lightning Experience continues to evolve with modern web standards, and that evolution can have unintended impact on Selenium-based tests. Our posts will provide measures to deal with the changes introduced by the new web technologies.<\/p>\n<blockquote><p>Not familiar with Selenium WebDriver? It is the <a href=\"https:\/\/www.w3.org\/TR\/webdriver\/\">de-facto standard<\/a> open-source-tool for testing web applications like the Salesforce app. Learn more about Selenium WebDriver on <a href=\"https:\/\/selenium.dev\/\">its home page<\/a> or <a href=\"https:\/\/en.wikipedia.org\/wiki\/Selenium_(software)\">this Wikipedia article<\/a>. This <a href=\"https:\/\/github.com\/SeleniumHQ\/selenium\/wiki\/Getting-Started\">5 Minute Getting Started Guide<\/a> leads you through the first steps to run tests automatically. In June 2013 the tool was also the topic of this <a href=\"https:\/\/developer.salesforce.com\/blogs\/engineering\/2013\/06\/automated-testing-using-selenium-at-salesforce.html\">Salesforce Developer blog post<\/a>.<\/p><\/blockquote>\n<p>In this first post, we cover automation of the global search field in the Lightning UI. The global search field is one of the most popular features used by end users, and many automated UI test cases will need to implement steps that work with this UI element. We\u2019ll start with a simple query and then move to more complicated settings \u2014 the use of categories for restricting the search and how to make the use of categories dynamic. By following the steps here, you will be able to automate these tasks in a fast yet robust way.<\/p>\n<h3>Task 1: Enter a search term in the global search field and start the search<\/h3>\n<p>Here is a very simple, straight-forward implementation, assuming you have to test the UI in one language only and that would be English:<\/p>\n<pre>01 WebElement inputBox = wd.findElement(By.xpath(\"\/\/input[@title='Search Salesforce']\"));\r\n02 inputBox.click();\r\n03 inputBox.clear();\r\n04 inputBox.sendKeys(\"CS88 Corp\");\r\n05 inputBox.click();\r\n06 wd.findElement(By.xpath(\"\/\/span[@title='CS88 Corp']\"));\r\n07 inputBox.sendKeys(Keys.RETURN);\r\n08 wd.findElement(By.xpath(\"\/\/a[@title='CS88 Corp']\"));<\/pre>\n<p>Line-by-line:<\/p>\n<ol>\n<li>Line 1: If you are covering only a single UI user language, then searching for an element by using a UI text is the most simple differentiator. If you need to cover multiple languages, you could perhaps get the correct text from a dictionary. See the line-by-line description for Task 2 below for what the approach could look like.<\/li>\n<li>Line 2: This click sets the cursor in the search box.<\/li>\n<li>Line 3: Remove any previously entered text.<\/li>\n<li>Line 4: Insert the search term of your choice.<\/li>\n<li>Line 5: This click kicks off the search.<\/li>\n<li>Line 6: Using findElement() is an easy way to assert that an element is present. If not, Selenium will throw a proper exception and your test will fail in a way you can easily triage the problem. Here we assert that the list of most recently used records is listing the record we are looking for.<\/li>\n<li>Line 7: Sending a Return keystroke will finally kick off the search.<\/li>\n<li>Line 8: Verify that the search returned the expected record.<\/li>\n<\/ol>\n<p>You may have noticed that this code works without a single Thread.sleep() call! Why? Because WebDriver does a lot of things under-the-hood to ensure stable test execution. We will have more on this in a future post.<\/p>\n<p>Is this the only way to implement testing the global search field? No, it\u2019s not. However, it is an approach which is both simple and robust.<\/p>\n<h3>Task 2: Select a category for filtering before entering a search term in the global search field<\/h3>\n<p>For clarification purposes, this picture shows where you can set a category for filtering the search result:<\/p>\n<p>\n\t\t\t  <span >\n\t\t\t    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/20191219161407\/Global-Search-Field-Task-2-Select-category-Account.png\" width=\"724\" height=\"398\" alt=\"\" \/>\n\t\t\t  <\/span>\n\t\t\t<br \/>\nThis code example builds on the above example:<\/p>\n<pre>01 WebElement inputBox = wd.findElement(By.xpath(\"\/\/input[@title='\" + getSearchHint() + \"']\"));\r\n02 WebElement categoryHome = wd.findElement(By.xpath(\"\/\/input[@id='input-5']\"));\r\n03 categoryHome.click();\r\n04 wd.findElement(By.xpath(\"\/\/lightning-base-combobox-item[@id='input-5-1-5']\")).click();\r\n05 inputBox = wd.findElement(By.xpath(\"\/\/input[@title='Search \" + getSearchHintForAccounts() + \"']\"));\r\n06 inputBox.click();\r\n07 inputBox.clear();\r\n08 inputBox.sendKeys(\"CS88 Corp\");\r\n09 inputBox.click();\r\n10 wd.findElement(By.xpath(\"\/\/span[@title='CS88 Corp']\"));\r\n11 inputBox.sendKeys(Keys.RETURN);\r\n12 wd.findElement(By.xpath(\"\/\/a[@title='CS88 Corp']\"));<\/pre>\n<p>Line-by-line unless covered in Task 1:<\/p>\n<ol>\n<li>Line 1: This assumes getSearchHint() gets you the right text from a dictionary which is based on UI user language setting. I leave the implementation of getSearchHint() up to you.<\/li>\n<li>Line 2: This is the input field directly on the left side of the global search box. The use of By.xpath instead of <a href=\"http:\/\/By.id\">By.id<\/a> is intentional and is because of Lighting Web Components (LWC). We will have more on this in a later post.<\/li>\n<li>Line 3: A click in that input field expands the list of categories the user can choose from.<\/li>\n<li>Line 4: Finding any entry in the list is actually quite tricky, because a right-mouse click on it to inspect in your browser\u2019s developer console makes the list vanish without updating the console. However, once you have expanded the list and are inspecting the input field in the console, you will find an attribute of type \u201caria-activedescendant\u201d. This <a href=\"https:\/\/youtu.be\/iG61dv4TUtw\" target=\"_blank\" rel=\"noopener noreferrer\">short video<\/a> shows how.<\/li>\n<li>Line 5: Now that a filter is established, the selector for the input box needs an update. If your user language setting is English, the <b>title<\/b> attribute needs to have the value \u201cSearch Accounts\u201d. Similar to line 1, we call a dictionary to get right text based on the UI user language setting.<\/li>\n<li>Lines 6-12: See comments for lines 2-8 for Task 1.<\/li>\n<\/ol>\n<p>As mentioned above, this too is technically, still pretty simple, don\u2019t you agree? The exception is of course figuring out how to get to the right element in the list of categories. In the next example we will explore how to use an arbitrary category name.<\/p>\n<h3>Task 3: Select a category by name for filtering<\/h3>\n<p>This code example is a variation of the above example:<\/p>\n<pre>01 WebElement inputBox = wd.findElement(By.xpath(\"\/\/input[@title='\" + getSearchHint() + \"']\"));\r\n02 WebElement categoryHome = wd.findElement(By.xpath(\"\/\/input[@id='input-5']\"));\r\n03 categoryHome.click();\r\n04 wd.findElement(By.xpath(\"\/\/lightning-base-combobox-item[@data-value='FILTER:Account:Accounts']\")).click();\r\n05 inputBox = wd.findElement(By.xpath(\"\/\/input[@title='Search \" + getSearchHintForAccounts() + \"']\"));\r\n06 inputBox.click();\r\n07 inputBox.clear();\r\n08 inputBox.sendKeys(\"CS88 Corp\");\r\n09 inputBox.click();\r\n10 wd.findElement(By.xpath(\"\/\/span[@title='CS88 Corp']\"));\r\n11 inputBox.sendKeys(Keys.RETURN);\r\n12 sleep(1000L);\r\n13 wd.findElement(By.xpath(\"\/\/a[@title='CS88 Corp']\"));<\/pre>\n<p>Line-by-line unless covered in Task 2:<\/p>\n<ol>\n<li>Lines 1-3. See comments for same lines for Task 2<\/li>\n<li>Line 4. The interesting part here is the value of the attribute <b>data-value<\/b>. It is a concatenation of the object\u2019s API name in its singular form (\u201cAccount\u201d) and its plural form (\u201cAccounts\u201d) as defined in Setup. Hence this value will be the same even if using a different UI user language.<\/li>\n<li>Line 5-11. See comments for same lines for Task 2.<\/li>\n<li>Line 12. This is one of the rare examples where a Thread.sleep() call is actually required! We need to wait for the page to display the list of records found. If you leave the call out, the UI sometimes opens the record right away and the command on the next line will fail. We will have more on judicious uses of Thread.sleep() in a future post.<\/li>\n<li>Line 13. See comments for line 12 for Task 2.<\/li>\n<\/ol>\n<p>The examples in this post show how to:<\/p>\n<ul>\n<li>Write a test in a simple, yet robust way.<\/li>\n<li>Get information on an UI element from the browser\u2019s dev console, even if direct inspection is not possible.<\/li>\n<\/ul>\n<p>You also had a glimpse into what it means to test engineers if UI elements are now based on Lightning Web Components (LWC). At time index 0:05 of the video above, the mouse hovers over a node called <i>#shadow-root (user-agent)<\/i>. This indicates that the UI element has been ported over to LWC. We will have more on the changes that are introduced to the DOM by the LWC rollout that negatively impact automated UI tests in future posts.<\/p>\n<p>What challenges are you facing as a test engineer? Do you have any topics you would like to suggest for a future post? Please let us know by leaving a comment below. We are interested in hearing from you.<\/p>\n<h2>About the author<\/h2>\n<p>Georg Neumann is intimately familiar with Selenium since version 1. He is part of the Salesforce Central QE team, which is using Selenium tests written by Salesforce customers to test their own Salesforce implementation to find regressions introduced by Salesforce in a new release before they affect the customers. This service is called Business Scenario Testing (BST) and open to any Salesforce customers meeting the requirements for participation. Follow him on <a href=\"https:\/\/www.linkedin.com\/in\/georgneumann\/\">LinkedIn<\/a>.<\/p>\n","acf":{"canonicalid":"","language":"english","audio_url":"https:\/\/a.sfdcstatic.com\/developer-website\/blog-audio\/192966\/192966.mp3","hash":"098d1be55daf8fb1c16f3a1c3c3c8882","transcription_id":"cb3090bc-6a96-4cca-a506-c1b2017fadb2","ready":true},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.3 (Yoast SEO v25.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Automated Testing of Global Search in Lightning UI - Salesforce Developers Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automated Testing of Global Search in Lightning UI\" \/>\n<meta property=\"og:description\" content=\"We are excited to kick off a series of posts on Selenium WebDriver-based test automation best practices and tips for test engineers who are developing or maintaining test automation for Salesforce applications. Lightning Experience continues to evolve with modern web standards, and that evolution can have unintended impact on Selenium-based tests. Our posts will provide [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui\" \/>\n<meta property=\"og:site_name\" content=\"Salesforce Developers Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-26T19:00:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-05T09:21:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Georg Neumann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SalesforceDevs\" \/>\n<meta name=\"twitter:site\" content=\"@SalesforceDevs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Georg Neumann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui\",\"url\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui\",\"name\":\"Automated Testing of Global Search in Lightning UI - Salesforce Developers Blog\",\"isPartOf\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#primaryimage\"},\"image\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#primaryimage\"},\"thumbnailUrl\":\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png\",\"datePublished\":\"2019-12-26T19:00:37+00:00\",\"dateModified\":\"2025-11-05T09:21:14+00:00\",\"author\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/60be6be350fcce62d8cc34c152a45c62\"},\"breadcrumb\":{\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#primaryimage\",\"url\":\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png\",\"contentUrl\":\"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png\",\"width\":\"200\",\"height\":\"200\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.salesforce.com\/blogs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automated Testing of Global Search in Lightning UI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#website\",\"url\":\"https:\/\/developer.salesforce.com\/blogs\/\",\"name\":\"Salesforce Developers Blog\",\"description\":\"Elevating developer skills and connecting with the Salesforce Developers community\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/developer.salesforce.com\/blogs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/60be6be350fcce62d8cc34c152a45c62\",\"name\":\"Georg Neumann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/image\/88f6446b6466226e1f121c4c936d9990\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4c694dd68faf271fae1929e337d6cca3ff40773185096c01f9a16308b92780cb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4c694dd68faf271fae1929e337d6cca3ff40773185096c01f9a16308b92780cb?s=96&d=mm&r=g\",\"caption\":\"Georg Neumann\"},\"url\":\"https:\/\/developer.salesforce.com\/blogs\/author\/gneumann\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Automated Testing of Global Search in Lightning UI - Salesforce Developers Blog","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:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui","og_locale":"en_US","og_type":"article","og_title":"Automated Testing of Global Search in Lightning UI","og_description":"We are excited to kick off a series of posts on Selenium WebDriver-based test automation best practices and tips for test engineers who are developing or maintaining test automation for Salesforce applications. Lightning Experience continues to evolve with modern web standards, and that evolution can have unintended impact on Selenium-based tests. Our posts will provide [&hellip;]","og_url":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui","og_site_name":"Salesforce Developers Blog","article_published_time":"2019-12-26T19:00:37+00:00","article_modified_time":"2025-11-05T09:21:14+00:00","og_image":[{"width":200,"height":200,"url":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png","type":"image\/png"}],"author":"Georg Neumann","twitter_card":"summary_large_image","twitter_creator":"@SalesforceDevs","twitter_site":"@SalesforceDevs","twitter_misc":{"Written by":"Georg Neumann","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui","url":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui","name":"Automated Testing of Global Search in Lightning UI - Salesforce Developers Blog","isPartOf":{"@id":"https:\/\/developer.salesforce.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#primaryimage"},"image":{"@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#primaryimage"},"thumbnailUrl":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png","datePublished":"2019-12-26T19:00:37+00:00","dateModified":"2025-11-05T09:21:14+00:00","author":{"@id":"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/60be6be350fcce62d8cc34c152a45c62"},"breadcrumb":{"@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#primaryimage","url":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png","contentUrl":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png","width":"200","height":"200"},{"@type":"BreadcrumbList","@id":"https:\/\/developer.salesforce.com\/blogs\/2019\/12\/automated-testing-of-global-search-in-lightning-ui#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.salesforce.com\/blogs"},{"@type":"ListItem","position":2,"name":"Automated Testing of Global Search in Lightning UI"}]},{"@type":"WebSite","@id":"https:\/\/developer.salesforce.com\/blogs\/#website","url":"https:\/\/developer.salesforce.com\/blogs\/","name":"Salesforce Developers Blog","description":"Elevating developer skills and connecting with the Salesforce Developers community","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/developer.salesforce.com\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/60be6be350fcce62d8cc34c152a45c62","name":"Georg Neumann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/developer.salesforce.com\/blogs\/#\/schema\/person\/image\/88f6446b6466226e1f121c4c936d9990","url":"https:\/\/secure.gravatar.com\/avatar\/4c694dd68faf271fae1929e337d6cca3ff40773185096c01f9a16308b92780cb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4c694dd68faf271fae1929e337d6cca3ff40773185096c01f9a16308b92780cb?s=96&d=mm&r=g","caption":"Georg Neumann"},"url":"https:\/\/developer.salesforce.com\/blogs\/author\/gneumann"}]}},"jetpack_featured_media_url":"https:\/\/d259t2jj6zp7qm.cloudfront.net\/images\/v1533675979-trailhead_module_lightning_experience_development_kpnor3.png","authors":[{"name":"Georg Neumann","image_src":"https:\/\/secure.gravatar.com\/avatar\/4c694dd68faf271fae1929e337d6cca3ff40773185096c01f9a16308b92780cb?s=24&d=mm&r=g"}],"_links":{"self":[{"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/posts\/192966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/users\/3540"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/comments?post=192966"}],"version-history":[{"count":5,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/posts\/192966\/revisions"}],"predecessor-version":[{"id":192983,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/posts\/192966\/revisions\/192983"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/media\/189449"}],"wp:attachment":[{"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/media?parent=192966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/categories?post=192966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/tags?post=192966"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/developer.salesforce.com\/blogs\/wp-json\/wp\/v2\/coauthors?post=192966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}