Disadvantage of using Global Variables
In my work place we have 3 automation tester including myself so we all have some different sytles of scripting especially when it comes passing data to functions.
I tend to use local variables and pass them via the calling delaration as parameters. However my other colleagues like to delecare global variables that can be seen by all functions in script and project where it is declared.
I know as a developer this is not encouraged as it could be a potential security risk. So my question is from a testing perspective is there any disadvantage of using global variables cause I think its easier to script this way than passing varibles as parameters. However before I change my style I just wanted to put the question out there in case there is a risk of doing this.
Re: Disadvantage of using Global Variables
Yes, and the risk is the same as it is for development. The variable is used everywhere and can be changed everywhere. This means that you do not always know what the value of it is.
You test should be considered a developmentproject in it's own right... I would not advice you to change your style, convince your collegues that they too should follow coding guidelines to create better and more stable tests.