How to select files using selenium vba
I want to automate the converstion pdf file into text using the online convertion program: https://pdftotext.com/
I use the selenium vba. Instead of clicking the button “wählen“ using this code: bot.FindElementById (“pick-files“).click
and then select the pdf file manually, I would like to pass the pdf file name directly using selenium vba. Until now, I have
always select the pdf file manually.
Can anyone help me how to do this, since I am new in programming with selenium VBA.
My second question ist, how can I set the default download location for the chrome browser, using selenium vba access or
excel. Thank you for your help in advance.
Hi @Jakapeka Its not possible to select the file using selenium script but you can do a workaround if you know the file path. Write a script which pastes the path of the file and send enter key.
- Click select file button. This open the file select dialog
- Next line in script would be to paste the file path and press enter
Thank you very much for your reply. I will try your suggestion. In the meantime I got already the solution.
@Jakapeka You can share your solution as well here
This is the solution
Set ele = Bot.FindElementByCss("#upload-buttons-wrapper > div.moxie-shim.moxie-shim-html5 > input[type=file]").SendKeys("D:\Test.pdf")
Ah thanks @Jakapeka Remembering some old selenium stuff now.
This post is deleted!