I'm new to the test automation script, so forgive me if this is a stupid question, but Google failed me this time. Or at least everything I read just embarrassed me.
I am using JUnit 4 and Selenium Webdriver in Eclipse. I have several tests that I need to run both a set and individually. At the moment, these tests work fine when they run on their own. At the beginning of the test, the user is given an input window in which the tester first asks which server they should be tested on (this is a string variable that becomes part of the URL) and with which browser they want to test. At the time of running the tests in the package, the user is asked this at the beginning of each test, because, obviously, this is encoded into each of their @Before methods.
How can I take these values once and pass them to each of the testing methods?
So, if server = "server1" and browser = "firefox", then firefox is the browser I want to use selenium and the URL I want to open is http://server1.blah.com/ for all of the following testing methods . The reason I used separate @Before methods is because the required URL is slightly different for each testing method. each method checks a different page, such as server1.blah.com/something and server1.blah.com/somethingElse
Tests run fine, I just don’t want to continue to enter values, because the number of testing methods will ultimately be quiet.
I could also convert my tests to testNG if testNG has an easier way to do this. I thought the @BeforeSuite annotation might work, but now I'm not sure.
( )