I'm uploading a file to Gemini using Selenium but the problem is that when it uploads the file it only uploads a part of the file instead of the entire thing i.e. the file should not be 11 tokens.
Gemini auto-closes the iframe when the file is fully uploaded by default but when I run it through Selenium the upload is premature.
How do I make sure the entire file is uploaded?
Here's what my code looks like:
iframe_container = driver.find_element(By.CLASS_NAME, "picker-api-container")
current_iframe = iframe_container.find_element(By.TAG_NAME, "iframe")
driver.switch_to.frame(current_iframe)
file_input = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.TAG_NAME, "input")))
file_input.send_keys(os.path.abspath("/Users/Gimpy/Desktop/Documents/lessoninchem.txt"))```
https://cdn.discordapp.com/attachments/1061696544434311168/1239084308984238110/Screen_Recording_2024-05-12_at_1.06.02_AM.mp4?ex=6641a2b0&is=66405130&hm=707d2bac778463d0ba994967237809cb69cb4047ed631f4a09e5b70e0c8c3a35&
I had this idea of stopping the iframe from closing but it didn't exactly pan out. Also, tried adding implicit waits, but that didn't work either.