Selenium Test - saving a session in several test runs

I have the following problem. When I start the selenium test, to get to the part where the actual test is performed, I need to launch the browser, log in, perform some other operations, and then go to the part that I want to check.

Is there a way to do the first part only once, leave the session and browser open. And for the next Run test, just continue this session without starting it.

So basically I would have to initialize the test and leave the session open. And other tests that use this initialized session reuse the session each time.

I am using Java and Selenium RC.

Thank!

+3
source share
3

. # Selenium RC (, , NUnit test framework). Java ( JUnit), . JUnit, NUnit , , , .

(, (#) (Java)). # : [TextFixtureSetUp] - , NUnit .

   [TestFixtureSetUp]
    public void SetupTest()
    {
        selenium = Setup.StartSelenium();
        Setup.Login();
        Setup.Preliminaries();
    }

Java @BeforeClass,

public class Example {
    @BeforeClass
    public static void onlyOnce() {
       ...
    }
 }

- Selenium Sushi: #, Java.

+1

testng, java , @BeforeClass, @BeforeSuite . selenium, , ( ), .

0

: firefox.

: 1. firefox (, -, , ) 2. Firefox > a > > ( ). 3. selenium webdriver ( RC, ),

ProfilesIni profileIni = new ProfilesIni();
FirefoxProfile profile = profileIni.getProfile("<YOUR PATH TO FF PROFILE FROM STEP 2>");
this.driver = new FirefoxDriver(profile);

, . , , firefox

0

All Articles