Feb-27-2019, 11:54 PM
(This post was last modified: Feb-27-2019, 11:55 PM by loganpmgoa.)
(Feb-27-2019, 10:55 PM)nilamo Wrote: What does "select" mean, in this context?
I'd be surprised if you could do anything to the file upload dialog in a browser. That'd be a major security hole, and browsers don't normally leave too many of those open.
Select means... like the same way it'd look when you click on the file with the mouse.
Can we do it in normal windows explorer then, and have winautomation (auto mouse/keyboard contoller program) ctrl+drag it to the chrome UL window? That way it'd be automatically selected to upload, just won't be in the same folder which is fine.
if you run
pip install pyperclip
in cmd and then run the code I just built
import subprocess import pyperclip #cross-platform clipboard module path = pyperclip.paste() #grabs the clipboard & pastes it as variable "path" extra = r'"' + path + '"' #combines extra code to get ready for subprocess module subprocess.Popen('explorer /select, ' + extra) print(extra)then it'll grab the path from the clipboard & open an explorer window that'll auto select the file in the path. (this assumes the clipboard looks like D:\Documents\Downloads\AutomationTesting\2019-02-25\BE007-BAGedge 6 oz. Canvas Promo Tote-BLACK.jpg or similar.)
what i don't know is how to build on this to put the path in the clipboard, including the file name, and have it auto change to the next file every time.