How to apply the Pool selenium to seleniumbase #1719
Answered
by
mdmintz
sunny9495-dev
asked this question in
Q&A
|
Hi, I have the following multiprocessing Pool code How seleniumbase can be applied to the same environment, especially with As a beginner, need some clarifications, Any help would be appreciated..Thanks.. |
Answered by
mdmintz
Jan 31, 2023
Replies: 1 comment
|
You can use parameterization for repetitive actions. Eg: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py In your case, the test would look like this: import random
from parameterized import parameterized
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "-n=5")
class ParameterizedTests(BaseCase):
@parameterized.expand(
[
["https://wordpress.com/create-website/"],
["https://www.tumblr.com/register?source=login_register_header_mobile"],
["https://squareup.com/signup"],
["https://en.over-blog.com/"],
["https://issuu.com/signup?plan=free"],
]
)
def test_parameterized_navigation(self, url):
self.open(url)
self.sleep(random.randint(3,6))Then run it like this: pytest -n=5SeleniumBase automatically downloads drivers that you need based on the version of the browser that you have installed. |
0 replies
Answer selected by
mdmintz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use parameterization for repetitive actions. Eg: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py
In your case, the test would look like this: