Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.

Slides:



Advertisements
Similar presentations
Regular Expressions in Perl By Josue Vazquez. What are Regular Expressions? A template that either matches or doesn’t match a given string. Often called.
Advertisements

ISBN Regular expressions Mastering Regular Expressions by Jeffrey E. F. Friedl –(on reserve.
Regular Expressions. u A regular expression is a pattern which matches some regular (predictable) text. u Regular expressions are used in many Unix utilities.
Regular expressions Mastering Regular Expressions by Jeffrey E. F. Friedl Linux editors and commands (e.g.
Scripting Languages Chapter 8 More About Regular Expressions.
CSE467/567 Computational Linguistics Carl Alphonce Computer Science & Engineering University at Buffalo.
REGULAR EXPRESSIONS CHAPTER 14. REGULAR EXPRESSIONS A coded pattern used to search for matching patterns in text strings Commonly used for data validation.
Last Updated March 2006 Slide 1 Regular Expressions.
Overview of the grep Command Alex Dukhovny CS 265 Spring 2011.
Regular Expression Darby Tien-Hao Chang (a.k.a. dirty) Department of Electrical Engineering, National Cheng Kung University.
System Programming Regular Expressions Regular Expressions
Pattern matching with regular expressions A common file processing requirement is to match strings within the file to a standard form, e.g. address.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
INFO 320 Server Technology I Week 7 Regular expressions 1INFO 320 week 7.
Finding the needle(s) in the textual haystack
RegExp. Regular Expression A regular expression is a certain way to describe a pattern of characters. Pattern-matching or keyword search. Regular expressions.
Regular expressions Used by several different UNIX commands, including ed, sed, awk, grep A period ‘.’ matches any single characters.X. matches any X.
CS 403: Programming Languages Fall 2004 Department of Computer Science University of Alabama Joel Jones.
Programming Languages Meeting 13 December 2/3, 2014.
Regular Expressions Regular expressions are a language for string patterns. RegEx is integral to many programming languages:  Perl  Python  Javascript.
1 Lecture 5 Additional useful commands COP 3353 Introduction to UNIX.
Perl and Regular Expressions Regular Expressions are available as part of the programming languages Java, JScript, Visual Basic and VBScript, JavaScript,
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
BTANT129 w61 Regular expressions step by step Tamás Váradi
CIS 218 Advanced UNIX1 Advanced UNIX CIS 218 Advanced UNIX Regular Expressions.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
I/O Redirection and Regular Expressions February 9 th, 2004 Class Meeting 4.
REGEX. Problems Have big text file, want to extract data – Phone numbers (503)
Corpus Linguistics- Practical utilities (Lecture 7) Albert Gatt.
When you read a sentence, your mind breaks it into tokens—individual words and punctuation marks that convey meaning. Compilers also perform tokenization.
Introduction to Regular Expression for sed & awk by Susan Lukose.
Regular Expressions in Perl CS/BIO 271 – Introduction to Bioinformatics.
Regular Expressions What is this line all about? while (!($search =~ /^\s*$/)) { It’s a string search just like before, but with a huge twist – regular.
Pattern Matching CSCI N321 – System and Network Administration.
Appendix A: Regular Expressions It’s All Greek to Me.
Sys Prog & Scrip - Heriot Watt Univ 1 Systems Programming & Scripting Lecture 12: Introduction to Scripting & Regular Expressions.
May 2008CLINT-LIN Regular Expressions1 Introduction to Computational Linguistics Regular Expressions (Tutorial derived from NLTK)
Advanced Text Processing. 222 Lecture Overview  Character manipulation commands cut, paste, tr  Line manipulation commands sort, uniq, diff  Regular.
CSC 2720 Building Web Applications PHP PERL-Compatible Regular Expressions.
Perl Day 4. Fuzzy Matches We know about eq and ne, but they only match things exactly We know about eq and ne, but they only match things exactly –Sometimes.
Copyright © Curt Hill Regular Expressions Providing a Search Pattern.
1 Lecture 9 Shell Programming – Command substitution Regular expressions and grep Use of exit, for loop and expr commands COP 3353 Introduction to UNIX.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Regular Expressions.
UNIX Commands RTFM: grep(1), egrep(1) & fgrep(1) Gilbert Detillieux April 13, 2010 MUUG Meeting.
CSCI 330 UNIX and Network Programming Unit IV Shell, Part 2.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 5 – Regular Expressions, grep, Other Utilities.
CGS – 4854 Summer 2012 Web Site Construction and Management Instructor: Francisco R. Ortega Chapter 5 Regular Expressions.
Standard Types and Regular Expressions CS 480/680 – Comparative Languages.
ORAFACT Text Processing. ORAFACT Searching Inside Files grep - searches for patterns within files grep [options] [[-e] pattern] filename [...] -n shows.
-Joseph Beberman *Some slides are inspired by a PowerPoint presentation used by professor Seikyung Jung, which was derived from Charlie Wiseman.
Pattern Matching: Simple Patterns. Introduction Programmers often need to scan a file, directory, etc. for a specific substring. –Find all files that.
May 2006CLINT-LIN Regular Expressions1 Introduction to Computational Linguistics Regular Expressions (Tutorial derived from NLTK)
Filters and Utilities. Notes: This is a simple overview of the filtering capability Some of these commands are very powerful ▫Only showing some of the.
Awk 2 – more awk. AWK INVOCATION AND OPERATION the "-F" option allows changing Awk's "field separator" character. Awk regards each line of input data.
Lesson 4 String Manipulation. Lesson 4 In many applications you will need to do some kind of manipulation or parsing of strings, whether you are Attempting.
CIRC Summer School 2016 Baowei Liu
Selenium HP Web Test Tool Training
Regular Expressions Upsorn Praphamontripong CS 1110
Looking for Patterns - Finding them with Regular Expressions
Regular Expression - Intro
Lecture 9 Shell Programming – Command substitution
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Selenium WebDriver Web Test Tool Training
CS 1111 Introduction to Programming Fall 2018
CSE 303 Concepts and Tools for Software Development
Regular Expressions and Grep
Regular Expressions grep Familiy of Commands
Lab 8: Regular Expressions
Lecture 5 Additional useful commands COP 3353 Introduction to UNIX 1.
Presentation transcript:

Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel

2 Day 2 Matching Text Patterns

describe the expected text  Allow the user to describe the expected text, via the use of special characters.  Frequently required by Selenese commands:  assertText or waitForText  assertTitle  assertPrompt or waitForPrompt  assertConfirmation or waitForConfirmation and others …  Link locators can also utilize patterns

There are three ways to match patterns:  Globbing - Utilized in filename expansion at a DOS or Unix/Linux command line  Regular expressions - Supported by most high- level programming languages, and utilities grep, sed, and awk  Exact – useful if you needed to look for an actual asterisk character, or square brackets

Only two special characters are supported in Selenium  Asterisk (*): Translates to “match anything” ◦ Nothing ◦ Single character ◦ Many characters 1  Character Class [ … ]: Translates to “match any 1 character found inside the brackets PATTERN * Will match “PATTERN” PATTERN * Will match “PATTERN” PATTERN * Will match “PATTERNS” PATTERN * Will match “PATTERNS” PATTERN * Will match “PATTERN & MORE!” PATTERN * Will match “PATTERN & MORE!” [a-zA-Z0-9] Matches any alphanumeric character [a-zA-Z0-9] Matches any alphanumeric character [0-9] Matches any digit [0-9] Matches any digit [aeiou] Matches any lowercase vowel [aeiou] Matches any lowercase vowel

 To specify a globbing pattern for a Selenese command prefix the pattern with “glob:”  GLOB: is the default in Selenium IDE any one character exactly Unlike in DOS the (?) special character which translates to any one character exactly is not supported in Selenium CommandTargetValue clicklink=glob:*out assertTitleOrangeHRM*

 Much more versatile then GLOB  Many special characters and character grouping options supported. MATCH.any single character [ ]character class: any single character that appears inside the brackets *quantifier: 0 or more of the preceding character (or group) +quantifier: 1 or more of the preceding character (or group) ?quantifier: 0 or 1 of the preceding character (or group) {1,5}quantifier: 1 through 5 of the preceding character (or group) |alternation: the character/group on the left or the character/group on the right ( )grouping: often used with alternation and/or quantifier

Regular expression patterns need to be prefixed with “regexp:” or “regexpi:”  REGEXP : is case-sensitive  REGEXPI : is case-insensitive. CommandTargetValue clicklink=regexpi:.*out assertTitleregexp:OrangeHRM.* Note: Unlike GLOB, when using REGEXP the (*) character needs to be used together with a second qualifier.

 regexp:.*[0-9]{1,2}:[0-9]{2} [ap]m ◦ Will match 12 hour time format hh:mm  regexpi: ^[a-z]*$ ◦ Will match any 1 word in lower, upper, or mixed case.  regexp:.* thinks (dogs|cats|fish) make great pets.  :32 pm 9:19 pm 00:00 am HELLO Antidisestablishmentarianism cheese Alice thinks fish make great pets thinks dogs make great pets! NOBODY thinks cats make great pets?

 Useful when the string being matched contains special characters such as “** Disclaimers”  Exact patterns need to be prefixed with “exact:” CommandTargetValue assertTextPresentexact: ** Not for resale