I have to automate an application and am working on Windows machine.
On clicking some button, window popup opens where I can choose a file or enter the path. Upload functionality is working fine using the Robot class
. But finally scripts has to run on Linux node through Jenkins and I don't have access of those nodes. I have 2 issues here:
Scripts are running on headless browser, how to handle file upload here?
If I am setting options.setHeadless(false);
, will the chrome browser will run in foreground? If yes then how to handle file upload here?(As I don't have node access so can't check)
Try to upload the file in the windows pop up using a simple Shell scripts that can be stored in a vbs file and then call this file once your file upload button is clicked to enter path in to the window's pop up
Sample shell code
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "Your complete file path here"
WshShell.SendKeys "{ENTER}"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.