[英]Sending a path of a file to google drive
您可以在此处使用autoit在google drive中上传文件,使用selenium单击,一旦打开上传窗口,然后添加autoit代码即可上传文件。
public void uploadfilechromeforgdrive(String path, String fileName) throws InterruptedException {
Logger.info("Started uploading " + fileName + " in Progress");
String dllPath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test"
+ File.separator + "resources" + File.separator + "lib" + File.separator + "jacob-1.18-x64.dll";
File file = new File(dllPath);
System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());
AutoItX x = new AutoItX();
x.winActivate("Open");
x.winWaitActive("Open");
Thread.sleep(5000);
x.controlFocus("[CLASS:#32770]", "", "Edit1");
Thread.sleep(5000);
x.ControlSetText("[CLASS:#32770]", "", "Edit1", path + fileName);
Thread.sleep(5000);
Logger.info("The sent file name " + fileName);
x.controlClick("[CLASS:#32770]", "", "Button1");
Thread.sleep(50000);
Logger.info("Started uploading " + fileName + " completed");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.