Issue
HTML code for "choose a file" button
<input name="ctl00$PlaceHolderMain$UploadDocumentSection$ctl05$InputFile" type="file" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_InputFile" class="ms-fileinput ms-fullWidth" size="35" onfocus="ResetSpFormOnSubmitCalled();" onchange="CheckAssetLibMediaExtension()" title="Choose a file">
Python Code
choose_file= browser.find_element_by_id('ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_InputFile')
choose_file.send_keys(file_path)
But this is not working for me.
Solution
Some technology stacks will autogenerate the id's for elements and looking at how messy that id is it might be one of those. I would recommend using a different selector because of this.
This may work better for you if there is only one file upload button:
browser.find_element_by_css_selector('input.ms-fileinput')
Answered By - Ryan Nygard
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.