1

Scenario :Suppose in a portal we have a link to download file every time user click on link and new file get downloaded how to check which is the latest file?

  • selenium is used to interact with a browser, you probably want another tool to interact with a filesystem to check if the file is there. You should be able to do this fairly easily through code or a small script. If you want to interact with the desktop, then it gets a little harder, but I'm not sure why you would want to do that if you just want to check if a file is there with a size greater than 0. – mrfreester Aug 28 '17 at 18:26
  • @mrfreester i would like to do that as i mention any time user click on download link a new file get downloaded so if user click on link for 3 time 3 file are getting downloaded eg:File_randomenumber_34567,File_randomenumber_34557,File_randomenumber_34807 so i need to search for the latest file and read the data from the file and compare data that of portal. – Mr.Learner Aug 28 '17 at 18:35
  • I think you might be better off searching stack overflow for questions on how to read data from files as this is more of a general programming type of a question. – mrfreester Aug 28 '17 at 20:19
  • 1
    You should ask a more specific question. The information you have provided is not enough. There are thousands of possible ways each relevant to its particular case. – Alexey R. Aug 29 '17 at 10:41
1

You don't use Selenium.

Remember Selenium is the library that handles the communication between your test framework and the browser. Once the browser clicks to download a file Selenium has done its part and now you need to use your test framework to locate the file and perform any further non-browser actions.

| improve this answer | |
  • 1
    Thank you it worked as mention in your comment @Chris Kenst – Mr.Learner Apr 21 '19 at 5:34
  • @Mr.Learner Great! Can you accept this answer as the final one? – Chris Kenst May 2 '19 at 22:24
  • 1
    yes i accept as the final answer that framework should handle it @Christ Kenst – Mr.Learner Jun 2 '19 at 6:05
  • @Mr.Learner great, you just need to click that check mark next to the answer to mark it as such. – Chris Kenst Jun 3 '19 at 6:34
  • 1
    Thanks @Chris Kenst – Mr.Learner Jun 27 '19 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.