Hello,
I’m trying to upload a certificate to log onto a specific website.
For this task, I decided to use “Chose File”, but for some reason once its supposed to enter the file, it says that the file is not Found under that path.
(The input field does take .pfx files)
This is the Code in question:
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Open Google
Open Browser xxxxxxx firefox
Click Link xpath:/html/body/div[1]/div/div/div/main/div/div[1]/div[2]/div/div/div[1]/div/div/div/p/a
Wait Until Element Is Visible id:searchfile
Execute JavaScript document.querySelector('#certificateFileUploadInput.file-upload__inputFile').style.display='block';
This line of code is necessary, as the input field on the site is “greyed out”(disabled probably) but still changes once you use the button. This is the easiest way I’ve found to make it work with choose file.
Choose file id:certificateFileUploadInput C:/Users/xxxxxx/Downloads/xxxxx.pfx
Sleep 5s
Input Password id:standardPassword xxxxxxxxxx
Sleep 5s
Close Browser
This is the error message from the logs:
InvalidArgumentException: Message: File not found: C:/Users/xxxxxxx/Downloads/xxxxxxx.pfx
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:384:5
interaction.uploadFiles@chrome://remote/content/marionette/interaction.sys.mjs:579:13
I really hope im not being an idiot and this is a genuine problem , regardless thank you.