更改通过Selenium chromedriver下载的文件名 [英] Change file name downloading via selenium chromedriver

查看:527
本文介绍了更改通过Selenium chromedriver下载的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在致力于自动化,它会自动下载文件.下载开始前,我需要在chrome中更改文件名.

I am working on automation where it downloads files automatically. I need to change the file name in chrome before download starts.

IWebElement button = driver.FindElement(By.Id("ImagshowMR"));
Actions action = new Actions(driver);
action.MoveToElement(button).Perform();
button.Click();

在此按钮上单击文件,开始自动下载.谁能建议解决方案如何重命名文件?

At this button click file start automatic download. Can anyone suggest solution how to rename the file?

推荐答案

不是可能,由只是下载一些东西.

This is not possible by just using selenium, assuming you are attempting to enter a file name in the standard windows prompt that appears as you download something.

不过,您可以考虑将另一个UI测试框架集成到您的测试中,例如CodedUI,AutoIT或White.

You can however look at integrating another UI testing framework into your tests, such as CodedUI, AutoIT, or White.

这篇关于更改通过Selenium chromedriver下载的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆