Skip to content

Commit 808af95

Browse files
committed
Add an example test that uses multiple drivers
1 parent f11d155 commit 808af95

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

examples/test_multiple_drivers.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from seleniumbase import BaseCase
2+
3+
4+
class MultipleDriversTest(BaseCase):
5+
def test_multiple_drivers(self):
6+
self.open("data:text/html,<h1>Driver 1</h1>")
7+
driver2 = self.get_new_driver()
8+
self.open("data:text/html,<h1>Driver 2</h1>")
9+
self.switch_to_default_driver() # Driver 1
10+
self.highlight("h1")
11+
self.assert_text("Driver 1", "h1")
12+
self.switch_to_driver(driver2) # Driver 2
13+
self.highlight("h1")
14+
self.assert_text("Driver 2", "h1")

0 commit comments

Comments
 (0)