You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I'm not sure if elem_send_keys can handle external files. The example in the vintage is not very clear. For now, I wrote a javascript code to create a mock file, because I am not sure how to reach my local file using selenider.
elem_send_keys() does not work with file inputs. If you're using chromote, the CDP has a setInputFiles method, so you can probably do something like this:
Hello! I'm not sure if elem_send_keys can handle external files. The example in the vintage is not very clear. For now, I wrote a javascript code to create a mock file, because I am not sure how to reach my local file using selenider.
js_code <- "
const fileInput = document.querySelector('input[type="file"]');
const dataTransfer = new DataTransfer();
const fileContent =
RTTQ.SF11KS RTTQ.SF91KS RTTQ.SFA1KS RTTQ.SFB1KS RTTQ.SFC1KS RTTQ.SFE1KS RTTQ.SFF1KS RTTQ.SFG1KS RTTQ.SFH1KS RTTQ.SFJ1KS RTTQ.SFK1KS RTTQ.SFL1KS RTTQ.SFM1KS RTTQ.SFP1KS RTTQ.SFQ1KS RTTQ.SFU1KS RTTQ.SFV1KS
;const file = new File([fileContent], 'temp.sch', { type: 'application/x-sch' });
dataTransfer.items.add(file);
fileInput.files = dataTransfer.files;
fileInput.dispatchEvent(new Event('change'));
"
execute_js_expr(js_code)
The text was updated successfully, but these errors were encountered: