Skip to content
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

wait_for_file not working with .part files on Firefox. #55

Closed
lf2a opened this issue Jun 8, 2022 · 0 comments · Fixed by #61
Closed

wait_for_file not working with .part files on Firefox. #55

lf2a opened this issue Jun 8, 2022 · 0 comments · Fixed by #61
Assignees

Comments

@lf2a
Copy link
Contributor

lf2a commented Jun 8, 2022

Describe the bug
It is not waiting for the download to finish because there is no 100MB.bin.part file, Firefox creates a 100MB.<hash>.bin.part file

if self.browser == Browser.FIREFOX and os.path.exists(path + '.part'):

Expected behavior
Wait for the download to finish and the .part file to be deleted.

Steps to Reproduce

from botcity.web import WebBot, Browser, By, browsers
from webdriver_manager.firefox import GeckoDriverManager


web = WebBot()
web.driver_path = GeckoDriverManager().install()
web.browser = Browser.FIREFOX
web.headless = False

web.browse("https://speed.hetzner.de/")
element = web.find_element(by=By.XPATH, selector="/html/body/p[1]/a")
element.click()

self.wait(2_000)

if not web.wait_for_file('/home/luiz/Downloads/100MB.bin', 5_000):
    print('tiemout')

Possible Solution
It could be checked if the file has more than 0 bytes.

My Platform
* OS Version: Ubuntu 20.04.4 LTS
* Python Version: Python 3.8.10
* Packages Version:

botcity-framework-core>=0.2.9
botcity-framework-web>=0.5.2
botcity-maestro-sdk>=0.1.5
webdriver-manager==3.5.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant