Posts

Showing posts with the label RegularExpression

Regular Expression - Documentation

  Metacharacters Character What does it do? $ Matches the  end of the input . If in multiline mode, it also matches  before a line break character , hence every end of line. (?:x) Matches 'x' but  does NOT remember the match . Also known as NON-capturing parenthesis. (x) Matches 'x' and  remembers the match . Also known as capturing parenthesis. * Matches the preceding character  0 or more times . + Matches the preceding character  1 or more times . . Matches  any single character except the newline character . ? Matches the preceding character  0 or 1 time . When used after the quantifiers *, +, ? or {},  makes the quantifier non-greedy ; it will match the minimum number of times as opposed to matching the maximum number of times. [\b] Matches a  backspace . [^abc] Matches  anything NOT enclosed by the brackets . Also known as a negative character set. [abc] Matches  any of the enclosed characters . Also known as a charac...

How to Use the VBScript RegExp Object

  Hi All, I faced a situation where I had to update the field’s value from another file. I can not use the string replace method because It will replace the all the matches value, While I want to replace the first match with the first value of another file.  Here I am trying to explain First File Contents: This blog refers to QTP. I want to get first line value "="   from another file. Here I am using Rexexp with global property value false Now I want to get Second line value "="   from another file. Global property false will serach only first match If regexp global property true then it search all the matches Now I want to get Third line value "="   from another file. Second File Contents: Rajiv Kumar Nandvani I want output like this: This blog refers to QTP. I want to get first line value " Rajiv "  from another file. Here I am using Rexexp with global property value false Now I wan...

Use Regular Expressions QTP

Image
Some Time QTP not recognize the application object during seond run it Or it run first time successfully then QTP give an error cannot identified the application Window object properties does not match with the test object. there might be a case of window name /object name change each time. Here we required the use of regular expression See the example Regular Expression During Recording of  Flight application QTP record the flight application it identified the Fax order window name property like this It Text Property is Fax order 11 If you run this script Again it will give an error because Fax order Window name will be Fax order 12 Regular Cannot identify the object “Fax Order No. 11″ (of class Dialog). Verify that this object’s properties match an object currently displayed in your application. Line (1): “Window(“Flight Reservation”).Dialog(“Fax Order No. 11″).Activate”. Now we change text property to regular expression open Object properties from object repository...