regular expression with selenium

by admin on May 17, 2013

My object in the application changes its property frequently; some part of it though remains common; how can I use regular expression to handle it with selenium?

#SQASolutionShare on FacebookShare on Google+Share on LinkedInTweet about this on TwitterEmail this to someone

{ 3 comments… read them below or add one }

amit srivastava May 17, 2013 at 7:09 pm

Try this framework over selenium called as OpKey. It is free to use. It has a great module called as Object repository which allows hassle free object management experience. Link is – http://opkey.crestechglobal.com/

Vineet Sharma May 17, 2013 at 7:09 pm

You have two option, better to use regular expression logic(for this you need to learn specific programming language regular expression chapter). Another one is try to find out some static object i.e link css and xpath etc.

For regular expression plz have look following link:

http://www.theautomatedtester.co.uk/tutorials/selenium/selenium_regular_expression.htm

Jitendra Jogeshwar May 17, 2013 at 7:09 pm

Apart from using regular expression. I would suggest you put your object identifiers outside your code like in a properties,excel or xml file so the impact of change can managed more easily

Previous post:

Next post: