Skip to content

Saving and loading cookies for a future test case #1234

Answered by mdmintz
akunteseterwork asked this question in Q&A
Discussion options

You must be logged in to vote

Instead of doing that, run pytest using --reuse-session (or --rs), and have only your first test perform the login. You can mark a test to go first by adding @pytest.mark.run(order=1):

import pytest
from seleniumbase import BaseCase

class MyTests(BaseCase):
    @pytest.mark.run(order=1)
    def test_aaa(self):
        ...

While reusing a session with --reuse-session, all tests will run in the same browser window.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@akunteseterwork
Comment options

@mdmintz
Comment options

@akunteseterwork
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants