Hi Telerik Team,
I have a method that generates a random number that is used to populate a textbox. This code works fine within a test but I would like to move it into a separate library where all my tests within the project can access & use it (the broader goal being to put multiple methods in one place).
So right now I have WebTest1 which has a coded step to call this function (getNumber) however it is failing with this error:
c:\QA_Test_Automation\Test Suite\Work In Progress\WebTest1.tstest.cs: Line 82: (CS0120) An object reference is required for the non-static field, method, or property 'Test_Suite.Utility.getNumber()'
Here is how I am calling the method from within WebTest1.tstest:
"Enter text '' in 'TxtSearchText'"
randomNum = Utility.getNumber();
And here is how I have the method setup within the UtilityTest1.tstest:
System.Random random =
randomNum = random.Next(100000000,999999999);
Both files exist within the same project. Any clue on what I am doing wrong? I was also following this link:
My version of Test Studio is 2012.2.1527.0
Thank you for any help.