Replies: 4 comments 7 replies
-
Hi @Jeremy-QA, |
Beta Was this translation helpful? Give feedback.
-
Hi @mdmintz thank you for your response. I have so much fun learning your framework. Can I ask how to achieve or the best way to continue reusing a session on self.get_new_driver(). Here is my code. In My case the execution of will stop at test_b ClassA (BaseCase) def open_original_window(self): def open_new_window(self,invitation_link ): ClassB (BaseCase) def continue_testing(self): Class MainTest(ClassA, ClassB) @pytest.mark.run(order=1) @pytest.mark.run(order=2) @pytest.mark.run(order=3) |
Beta Was this translation helpful? Give feedback.
-
Here are a few examples to explain Example 1:
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "--rs")
class MyClass(BaseCase):
def test_1(self):
self.open("data:text/html,<h1>Page A</h1>")
self.sleep(2)
def test_2(self):
self.get_new_driver()
self.open("data:text/html,<h1>Page B</h1>")
self.sleep(2)
def test_3(self):
self.open("data:text/html,<h1>Page C</h1>")
self.sleep(2) Example 2: (Add an import
from seleniumbase import BaseCase
from seleniumbase import config as sb_config
BaseCase.main(__name__, __file__, "--rs")
class MyClass(BaseCase):
def test_1(self):
self.open("data:text/html,<h1>Page A</h1>")
self.sleep(2)
def test_2(self):
self.get_new_driver()
sb_config.shared_driver = self.driver
self.open("data:text/html,<h1>Page B</h1>")
self.sleep(2)
def test_3(self):
self.open("data:text/html,<h1>Page C</h1>")
self.sleep(2) To summarize: Use |
Beta Was this translation helpful? Give feedback.
-
it works 👍 💯 thank you so @mdmintz |
Beta Was this translation helpful? Give feedback.
-
Hello, how to get the session browser of self.get_new_driver() to run in other test_aa. Currently i am using --reuse-session and running smoothly. But when I declare self.get_new_driver() in my page object it will not continue executing
Beta Was this translation helpful? Give feedback.
All reactions