lucieneven
13 years agoContributor
can we avoid too many magic numbers in the script?
Hello,
When i checked my script recorded by TestComplete, i noticed many Magic numbers. One thing i don't understand is why TestComplete will note down the coordinate value like below:
Call table.cell1.linkJavascriptSubmit.textnodeLogin.Click(25, 7)
Instead, I tried the QTP, simple the code is like below:
Browser("JMap Admin").Page("JMap Admin").Link("Login").Click
That's for the same operation, click login links.
This kind of existing magic numbers makes me a little bit upset, because when playing back the script, from times to times, it happens to me that object not found or doesn't exist.
May i ask whether this is an issue or there's something we can do to work around the magic numbers.
Thanks for your help,
Lucien
When i checked my script recorded by TestComplete, i noticed many Magic numbers. One thing i don't understand is why TestComplete will note down the coordinate value like below:
Call table.cell1.linkJavascriptSubmit.textnodeLogin.Click(25, 7)
Instead, I tried the QTP, simple the code is like below:
Browser("JMap Admin").Page("JMap Admin").Link("Login").Click
That's for the same operation, click login links.
This kind of existing magic numbers makes me a little bit upset, because when playing back the script, from times to times, it happens to me that object not found or doesn't exist.
May i ask whether this is an issue or there's something we can do to work around the magic numbers.
Thanks for your help,
Lucien