Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
Lampie1973
Posts : 1
Join date : 2012-01-31

Less script maintenance by using suites instead of scripts for building your tests so you can use 'includes' Empty Less script maintenance by using suites instead of scripts for building your tests so you can use 'includes'

Tue Jan 31, 2012 7:50 pm
I have been working for more than a year now with Selenium IDE and noticed that the maintenance on the scripts can become high when screens changes etc. Next to that I have seen that the quality of your scripts improves over time which means you constantly have to go back to older scripts and also improve them 1 by 1.

To solve this problem I have come up with a complete new way of working. In the Selenium core this was already possible because you have the include statements but these are not available in the IDE. I wanted to make it possible for less experienced Selenium users to still built scripts from small blocks. This way it should become possible to built test scripts faster and of better quality.

My solution to the problem:
1 - built small test scripts which contain the base blocks that you need to do something (login, click on ok button, select account etc.). Most scripts will only contain 1 command but some will have a few commands. (important note is that the script should start with a comment which is the script name so you can find it back later).
2 - built a suite file and add the blocks that you created (basically this script will have all the steps needed to complete the full test)
3 - convert the suite file into a test script so it can be run by the default tools.

I built a small Excel Macro to do this for me but you can probably do this in any other programming language you want. I like Excel because almost everybody has it available on his PC. The program will read the Suite file, find the scripts that it refers to, read the scripts and finally creates 1 full script out of them. The new script will have the same file as the original suite but it will be on a different location (this to avoid confusion and perhaps overriding the suite files which you don't want).

Advantages:
- the basic blocks that you built will always have the same quality
- If a screen changes somewhere than you will only have to change the block(s) that are interacting with that screen. After that you convert all the suites to scripts again and the new scripts will automatically contain the changed block(s).
- It is very easy to add a step to a block so that all scripts will start using that step after the rebuilt.


At this point I am still experimenting with it but I notice that it really works. I can built new script within 10 minutes without too much trouble just by creating a new suite and start adding the basic scripts. 1 press of the button and all the suites will be transformed into scripts. another press on the button and they are running.

Did anybody else already found this way of working? Or perhaps even a better way of being more flexible using the Selenium IDE? What I am doing is a bit against the basic logic of Selenium because they only use the suites for running the test scripts. I am now 'abusing' the suites a bit but must say it does work and does allow a lot of flexibility Smile

I am curious about any reactions/ suggestions.

Cheers,
Erwin
avatar
freesky
Amateur
Amateur
Posts : 72
Join date : 2011-04-13

Less script maintenance by using suites instead of scripts for building your tests so you can use 'includes' Empty Re: Less script maintenance by using suites instead of scripts for building your tests so you can use 'includes'

Mon Feb 13, 2012 11:21 am
Thanks for sharing. Could u post the detail, such as excel content, source code etc? Thanks.
avatar
Sanjay S
Regular Participant
Regular Participant
Posts : 34
Join date : 2012-02-10
Age : 36
Location : Chennai

Less script maintenance by using suites instead of scripts for building your tests so you can use 'includes' Empty Re: Less script maintenance by using suites instead of scripts for building your tests so you can use 'includes'

Thu Feb 23, 2012 12:03 pm
Awesome Smile
Sponsored content

Less script maintenance by using suites instead of scripts for building your tests so you can use 'includes' Empty Re: Less script maintenance by using suites instead of scripts for building your tests so you can use 'includes'

Back to top
Permissions in this forum:
You cannot reply to topics in this forum