How to Validate Downloaded file after clicking on downloaded button/ link in chrome browser
It is unclear what do you mean by "Validate". If you are downloading a document and your target is to check its content the question is not related to Selenium as Selenium is browser automation framework.
See Examples section to get started with Tika.
If you're using a different client language search for similar libraries to parse downloaded file and extract its content.
- Create a digital signature of a valid file
- After download get the signature of downloaded file
- Compare the signatures. If they are the same the download is valid.
You can use the MD5 command line tool to create and compare the signatures. The big con is that you need to update the signature if the file changes, possible you need a way to get a dynamic signature after processing.
Also read this blog, which has a MD5 example: http://ardesco.lazerycode.com/testing/webdriver/2012/07/25/how-to-download-files-with-selenium-and-why-you-shouldnt.html
Your question is not really clear, so I have to make a few assumptions here:
- You are using selenium to automate your tests
- You know how to access directories on your own PC
My suggestion is:
- Use selenium to click this download button
- Get the file name that you want to download, say it is "
- Access the folder where you save your downloaded files
- Make sure there is no "
chrome.exe" previously saved, if there is one or more, you will need to delete them before you test starts OR use regular expression to locate the latest one
Without much details, this is about as much as I can help you with.