-
Notifications
You must be signed in to change notification settings - Fork 1.3k
very long wait to open simple webpage via Driver with binary_location #2462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Duplicate of #2006 (comment) Only Other multithreading systems such as On top of that, you used the JS The UC Mode methods: driver.uc_open(url)
driver.uc_open_with_tab(url)
driver.uc_open_with_reconnect(url, reconnect_time=None)
driver.uc_click(selector)
driver.uc_switch_to_frame(frame) If you don't need to bypass bot-detection while opening a URL in UC Mode, use: |
The reason of going for that approach is i need to open 4 browsers for the same test and all that will be execute via exe from pyinstaller, do you have any recommendation or better implementation?
I used Driver because i need to execute throw pure python
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Michael Mintz ***@***.***>
Sent: Wednesday, January 31, 2024 6:36:52 AM
To: seleniumbase/SeleniumBase ***@***.***>
Cc: Marwan0 ***@***.***>; Author ***@***.***>
Subject: Re: [seleniumbase/SeleniumBase] very long wait to open simple webpage via Driver with binary_location (Issue #2462)
Duplicate of #2006 (comment)<#2006 (comment)>
Only pytest multithreading is supported via pytest-xdist.
(In the pytest Syntax Formats<https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md>, the driver is automatically quit at the end of each test.)
Other multithreading systems such as multiprocessing.Pool are likely to experience issues, such as slowness, poor handling of resources in threads, and other issues.
On top of that, you used the JS window.open() method instead of the built-in UC Mode methods for opening a URL, which may lead to issues. The UC Mode methods will automatically handle tab-switching as needed.
The UC Mode methods:
driver.uc_open(url)
driver.uc_open_with_tab(url)
driver.uc_open_with_reconnect(url, reconnect_time=None)
driver.uc_click(selector)
driver.uc_switch_to_frame(frame)
If you don't need to bypass bot-detection while opening a URL in UC Mode, use: driver.default_get(url), which loads a URL faster because there's no disconnect time between chromedriver and Chrome.
—
Reply to this email directly, view it on GitHub<#2462 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABTTAQYISD3A64HFDOKTNB3YRHC6JAVCNFSM6AAAAABCSJPJ46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJYGM3DKNJVGU>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
The A lot of the example tests that use the BaseCase.main(__name__, __file__) That triggers |
when i use Driver and pass binary_location of ChromeDriver.exe , the script hang and take very very long time to do any action , here is the script i use
`
import os
import sys
import time
from seleniumbase import Driver
from multiprocessing import Pool
import multiprocessing as mp
def get_binary_file_path(relative_path):
"""Get the path to the binary file whether script is run as a script or as an executable."""
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, relative_path)
else:
return os.path.join(os.path.abspath("."), relative_path)
def test_function(I):
if name == "main":
mp.freeze_support()
for i in range(5):
p = Pool(processes=3)
p.map(test_function, range(3))
p.close()
p.join()
time.sleep(0.5)
`
The text was updated successfully, but these errors were encountered: