How does multithreading with different websites work? #2409
Answered
by
mdmintz
jphfritsche
asked this question in
Q&A
-
I am trying to navigate to two websites in multiple threads.
Ideally in a loop
My problem is related to this example #2241 (comment) but as far as I understand this works only with a single website? Help would be very appreciated. Many thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
mdmintz
Jan 4, 2024
Replies: 1 comment 2 replies
-
You have to use ( Here's an example of from parameterized import parameterized
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "-n3")
class ProxyTests(BaseCase):
@parameterized.expand(
[
["host1:port1"],
["host2:port2"],
["host3:port3"],
]
)
def test_multiple_proxies(self, proxy_string):
self.get_new_driver(
undetectable=True, proxy=proxy_string, multi_proxy=True
)
self.driver.get("https://browserleaks.com/webrtc")
self.sleep(30) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
mdmintz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to use
parameterized
to pass in multiple args. (In your case, different websites.)(
pytest.parametrize
doesn't work withunittest.TestCase
inheritance.)Here's an example of
parameterized
for multiple proxies: