premganz / SeleniumPageObjects

An implementation of the Page Object Pattern in Selenium along with a bunch of other features like KeyWords for oft used Webdriver calls, driver lifecycle management, effective logging and Test Script Templates
Other
2 stars 1 forks source link

Regex based page match expansion #28

Closed premganz closed 8 years ago

premganz commented 8 years ago

The present page match syntax language has the keywords (surrounded by 3 asteriks) section: break section:regex end

The regex area has problems when we are generating large regex patterns with a lot of (._) wildcards interpersed, Optimization failed even after 2 days, some large regexs are failing due to catastrophic back tracking. Guess regex is not built for the job of matching huge templates to text contents. So the section:regex will now have to have a sub keyword like _expr* which will help evaluating one expression after another in the problem. Each time an expression is evaluated, the web page content is to be suitably edited by cutting out the matched content and then trying for the next experssion to match. Care should be taken to protect the order of expressions and proper logging.

premganz commented 8 years ago

fixed

premganz commented 8 years ago

Added an additional regex for conditional section like , having a section title that begins with ignore example Section:ignore_xyz* this can be printed in in case of a conditional such as

<%if(y) print ' *_Section:ignorexyz'%> <%if(!t) print' __Section:xyz'%> bla bla __end**

premganz commented 8 years ago

Fixed