[英]i am not able to view my downloaded file in downloads folder using selenium java
[Screenshot displaying the downloaded file in a window[][1] 1 i am not able to access my downloaded file which i opened in a new small window popup using selenium java and also i am not able to find it in downloads folder. [在窗口中显示下载文件的屏幕截图[][1] 1我无法访问我使用 selenium java 在新的小窗口弹出窗口中打开的下载文件,而且我也无法在下载文件夹中找到它。 When i click on a download button-->the file gets downloaded with an icon of word in a new small popup browser window-->but it does not move into the downloads folder .
当我单击下载按钮时--> 在新的小弹出浏览器窗口中下载带有单词图标的文件--> 但它没有移动到下载文件夹中。 Testcase passes but i am not able to validate.In that browser window i am not able to find any elements....only .... tags are displayed.. While doing it in manual way i am able to view it in downloads folder.
测试用例通过,但我无法验证。在那个浏览器窗口中,我无法找到任何元素......只显示......标签......虽然以手动方式进行操作,但我可以在下载中查看它文件夹。 Kindly advise me what should be done.
请告诉我应该怎么做。
you are coding in java
language,你正在用
java
语言编码,
so, use method exists()
which will return boolean value.因此,使用将返回布尔值的方法
exists()
。 You must know your Downloaded file name along with exact download path,您必须知道您下载的文件名以及确切的下载路径,
String FileName = "YOUR_FILE_NAME";
File tmpDir = new File("C:\Users\a.k\Downloads\"+FileName);
if(tmpDir.exists())
System.out.println("File Downloaded");
System.out.println("File Not Downloaded");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.