简体   繁体   English

我无法使用 selenium java 在下载文件夹中查看我下载的文件

[英]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.

相关问题 如何将下载的文件保存到Java Selenium中的特定文件夹中? - How to save a downloaded file into a particular folder in Java selenium? 如何使用Java从chrome下载列表[即chrome:// downloads]中获取最后下载的文件名? - how to get last downloaded file name from chrome download list [i.e. chrome://downloads] using java? 我无法使用 Selenium 启动浏览器 - I am not able to launch the browser by using Selenium Android:从“下载”文件夹中删除下载的文件快捷方式 - Android: Remove Downloaded file shortcut from "Downloads" folder 下载的文件没有出现在下载文件夹中(android Q) - Downloaded file does not appear in downloads folder (android Q) Selenium:使用Java打开下载的文件 - Selenium: Opening a Downloaded File in Java 检测在 selenium java 中下载的文件 - detecting a file downloaded in selenium java 我无法使用Selenium Webdriver以应用程序的模式登录形式输入电子邮件地址吗? - I am not able to enter a email address in modal login form of my application using selenium webdriver? 我正在尝试使用Java将MySql数据导出到文件中,但是我无法获取表头 - I am trying to export MySql data to a file using Java, but I am not able to get the table headers 我无法使用片段从我的活动中访问片段布局内的文本视图 - I am not being able to access the text view inside my fragment layout from my Activity using the fragment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM