0

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?

Lifewithsun
  • 968
  • 14
  • 34
  • 2
    I think there is no way to change file name before downloading when you download it with Browser. But you can try getting direct link to the file from button/link on page and download content of this link to any file you want. – sunigos Mar 29 '18 at 14:57

1 Answers1

0

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.

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

Rescis
  • 547
  • 5
  • 19