{"id":825,"date":"2013-01-02T09:47:36","date_gmt":"2013-01-02T09:47:36","guid":{"rendered":"http:\/\/vskills.in\/certification\/tutorial\/?p=825"},"modified":"2024-04-12T14:13:14","modified_gmt":"2024-04-12T08:43:14","slug":"regular-expression","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/","title":{"rendered":"Selenium Testing | Regular Expressions"},"content":{"rendered":"<h1>Selenium Testing | Regular Expressions<\/h1>\n<p><strong>Selenium testing<\/strong> is a software testing framework for web applications. Selenium is a strong set of tools that supports quick development of test automation for web-based applications. It was developed in 2004 by Jason Huggins as a <strong>JavaScript library<\/strong> used to automate his manual testing routines.<\/p>\n<p>Selenium Core is born whose functionality underlies the <strong>Selenium RC<\/strong> (Remote Control) and <strong>Selenium IDE<\/strong> tools.The Limitation of having a JavaScript based automation engine and browser security was a drawback of Selenium to specific functionality. Google, was the long time user of Selenium and they had a developer named Simon Stewart who developed WebDriver. This tool evaded Selenium\u2019s JavaScript sandbox to allow it to communicate with the Browser and Operating System directly using native methods.In 2008, Selenium and WebDriver merged technologies and intellectual intelligence to offer the best possible test automation framework.<\/p>\n<p>Selenium provides a set of testing functions specifically geared to the needs of testing of a web application. Selenium operations are highly flexible, allowing many options for placing UI elements and comparing expected test results against actual application behaviour. Components of Selenium are the following:<\/p>\n<ul>\n<li>Selenium IDE<\/li>\n<li>Selenium Remote Control<\/li>\n<li>Selenium Grid<\/li>\n<\/ul>\n<p><strong>Selenium IDE<\/strong><br \/>\nSelenium IDE is an integrated development environment for Selenium tests and is implemented as a Firefox extension, and allows you to record, edit, and replay the test in firefox. It allows you to save tests as HTML, Java, Ruby scripts, or any other format and thus allows you to automatically add assertions to all the pages. Selenium IDE allows you to add selenese commands as and when required.<\/p>\n<p><strong>Selenium IDE<\/strong> has some limitations, such as:<\/p>\n<ul>\n<li>Selenium IDE can be tested only on Firefox. No Programming login (like loops, conditional statements) can be applied<\/li>\n<li>It can execute scripts created in Selenese only.<\/li>\n<li>It is hard to use Selenium IDE for checking complex test cases involving dynamic contents.<\/li>\n<\/ul>\n<p><strong>Selenium Remote control<\/strong><br \/>\nSelenium remote control is a perfect solution to cross browser testing. It is a server, written in Java and thus available on all the platforms.It also acts as a proxy for web requests from them.Selenium remote control bundles Selenium Core and automatically loads into the browser.<\/p>\n<p><strong>Selenium Grid<\/strong><br \/>\n<strong>Selenium Grid<\/strong> scales the Selenium RC solution for large test suites and test that must be run in multiple environments. It helps to run tests parallel with simultaneous execution (different tests on different remote machines). It permits for running your tests in a distributed test execution environment. It can be used to run your tests against multiple browsers, multiple versions of browser, and browsers running on different operating systems. Selenium Grid takes comparatively less time for the test suite to complete a test pass.<\/p>\n<p><strong>Features<\/strong><br \/>\nThe following are the features of <strong>Selenium testing<\/strong>:<\/p>\n<ul>\n<li>Selenium testing supports Cross Browser Testing and thus it be run on multiple browsers.<\/li>\n<li>It allows scripting in numerous languages like Java, C#, PHP and Python.<\/li>\n<li>Its assertion statements give an efficient way of comparing expected and actual results.<\/li>\n<li>It has inbuilt reporting mechanism.<\/li>\n<\/ul>\n<p>Using Selenium as Test Automation tool reduces the cost incurred and also ensures faster delivery. Thus it is cost effective and also not time consuming which proves that this is a standard automation tool for regression.<\/p>\n<p>Of the three type of patterns, Regular Expressions are the one that are the most useful. Selenium supports the complete set of RegEx patterns that Javascript supports. So now you are not limited by the *,? And [] globbing patterns. To use RegEx patterns you need to prefix each RegEx with either <em>regexp:<\/em> or <em>regexpi:<\/em>, the latter being case-insensitive.<\/p>\n<p>For example the following will test if a input field with the id \u2018name\u2019 contains the string \u2018javascript\u2019, \u2018JavaScript\u2019 or \u2018Javascript\u2019.<\/p>\n<table>\n<colgroup>\n<col width=\"36%\" \/>\n<col width=\"38%\" \/>\n<col width=\"26%\" \/><\/colgroup>\n<thead valign=\"bottom\">\n<tr>\n<th><strong>Command<\/strong><\/th>\n<th><strong>Target<\/strong><\/th>\n<th><strong>Value<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody valign=\"top\">\n<tr>\n<td>clickAndWait<\/td>\n<td>link=search<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>verifyValue<\/td>\n<td>id=name<\/td>\n<td>regexp:[Jj]ava([Ss]cript)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Below are a few common regular expression patterns:<\/p>\n<p><strong>regexp:(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\\d\\d<\/strong><br \/>\n:match a date in \u2018mm\/dd\/yyyy\u2019 format with any of the \u2018-\u2019, \u2018\/\u2019, \u2018.\u2019 as separators.<\/p>\n<p><strong>regexpi:^[A-Z0-9+_.-]+@[A-Z0-9.-]+$<\/strong><br \/>\n:match a generic email address.<\/p>\n<p><strong>regexp:^[0-9]{5}(?:-[0-9]{4})?$<\/strong><br \/>\n:match a ZIP code (U.S. postal code), allowing both the five-digit and nine-digit (ZIP + 4) formats.<\/p>\n<p><strong>regexp:^(?!000|666)(?:[0-6][0-9]{2}|7(?:[0-6][0-9]|7[0-2]))-?(?!00)[0-9]{2}-(?!0000)[0-9]{4}$<\/strong><br \/>\n:match U.S Social Security numbers in the in the AAA-GG-SSSS format.<\/p>\n<p><strong>regexp:^(https?|ftp|file):\/\/.+$<\/strong><br \/>\n:match almost any url.<\/p>\n<h3><a href=\"https:\/\/www.vskills.in\/practice\/startPracticeTest\/Software-Testing-Introduction-Questions\">Free Selenium Practice Tests | Go To Selenium Practice Test Now<\/a><\/h3>\n<div class=\"apply\">\n<h3>Apply for Selenium Certification Now!!<\/h3>\n<p><a href=\"http:\/\/www.vskills.in\/certification\/Certified-Selenium-Professional\">http:\/\/www.vskills.in\/certification\/Certified-Selenium-Professional<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Selenium Testing | Regular Expressions Selenium testing is a software testing framework for web applications. Selenium is a strong set of tools that supports quick development of test automation for web-based applications. It was developed in 2004 by Jason Huggins as a JavaScript library used to automate his manual testing routines. Selenium Core is born&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"categories":[350],"tags":[395,7026,349,7027,6821,7025],"class_list":["post-825","page","type-page","status-publish","hentry","category-selenium","tag-regular-expression","tag-selenium-automation-testing","tag-selenium-certification","tag-selenium-documentation","tag-selenium-professional","tag-selenium-webdriver"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Selenium Testing | Regular Expressions<\/title>\n<meta name=\"description\" content=\"Selenium testing is a software testing framework for web applications. Selenium is a strong set of tools that supports quick development of test automation for web-based applications. Read more on Selenium Testin..\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selenium Testing | Regular Expressions\" \/>\n<meta property=\"og:description\" content=\"Selenium testing is a software testing framework for web applications. Selenium is a strong set of tools that supports quick development of test automation for web-based applications. Read more on Selenium Testin..\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:43:14+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/\",\"name\":\"Selenium Testing | Regular Expressions\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2013-01-02T09:47:36+00:00\",\"dateModified\":\"2024-04-12T08:43:14+00:00\",\"description\":\"Selenium testing is a software testing framework for web applications. Selenium is a strong set of tools that supports quick development of test automation for web-based applications. Read more on Selenium Testin..\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Selenium Testing | Regular Expressions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Selenium Testing | Regular Expressions","description":"Selenium testing is a software testing framework for web applications. Selenium is a strong set of tools that supports quick development of test automation for web-based applications. Read more on Selenium Testin..","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:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/","og_locale":"en_US","og_type":"article","og_title":"Selenium Testing | Regular Expressions","og_description":"Selenium testing is a software testing framework for web applications. Selenium is a strong set of tools that supports quick development of test automation for web-based applications. Read more on Selenium Testin..","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:43:14+00:00","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/","name":"Selenium Testing | Regular Expressions","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2013-01-02T09:47:36+00:00","dateModified":"2024-04-12T08:43:14+00:00","description":"Selenium testing is a software testing framework for web applications. Selenium is a strong set of tools that supports quick development of test automation for web-based applications. Read more on Selenium Testin..","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/regular-expression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Selenium Testing | Regular Expressions"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=825"}],"version-history":[{"count":10,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/825\/revisions"}],"predecessor-version":[{"id":59268,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/825\/revisions\/59268"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}