Open jasonchong3329 opened 1 year ago
It can be done with SeleniumBase and pytest
:
pip install seleniumbase
Then run the following with python
:
import pytest
from parameterized import parameterized
from seleniumbase import BaseCase
class RepeatTests(BaseCase):
@parameterized.expand([[]] * 4)
def test_repeat_this_test_with_parameterized(self):
self.open("https://nowsecure.nl")
try:
self.assert_text("OH YEAH, you passed!", "h1", timeout=6.75)
self.post_message("Selenium wasn't detected!", duration=1.6)
self._print("\n Success! Website did not detect Selenium! ")
except Exception:
self.fail('Selenium was detected! Try using: "pytest --uc"')
if __name__ == "__main__":
pytest.main([__file__, "--uc", "-n=4"])
Or you can run the above using:
pytest --uc -n=4
It can be done with SeleniumBase and
pytest
:pip install seleniumbase
Then run the following with
python
:import pytest from parameterized import parameterized from seleniumbase import BaseCase class RepeatTests(BaseCase): @parameterized.expand([[]] * 4) def test_repeat_this_test_with_parameterized(self): self.open("https://nowsecure.nl") try: self.assert_text("OH YEAH, you passed!", "h1", timeout=6.75) self.post_message("Selenium wasn't detected!", duration=1.6) self._print("\n Success! Website did not detect Selenium! ") except Exception: self.fail('Selenium was detected! Try using: "pytest --uc"') if __name__ == "__main__": pytest.main([__file__, "--uc", "-n=4"])
Or you can run the above using:
pytest --uc -n=4
I have tried seleniumbase , but seem like the website blocked . unable to do any action on the website. anyway thank for your help.
Dear developer,
Anyone facing this issue before?
when I try launch the multiple chrome browser at the same time but have only 1 browser success launch , another browser will have error : selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:45655
[Update] After check seem like only certain website blocked multiple launch the same website at the same time.
below is my chrome options :
Any solutions would be greatly appreciated.
thank you