Showme
Showme

Reputation: 69

How to test downloading files in Selenium2 using Java and then check the downloaded file' format?

I have an "Export" button so after click on it the .csv file with some data is downloaded.

Is there a way to test in Selenium2 the following points:

I will really appreciate all of the suggestions on how to do the tings above using Java.

Upvotes: 1

Views: 7127

Answers (3)

Manigandan
Manigandan

Reputation: 5082

Actually, It is not possible to handle the Native windows using the selenium web driver. You can go for the third party tool like AutoIT to resolve this kind of issue.

For more info on AutoIT Tutorial and this too.

Upvotes: 1

Sakib
Sakib

Reputation: 85

Integrate Sikuli library in your test script. You can easily compare through snapshot.

Upvotes: 0

Santoshsarma
Santoshsarma

Reputation: 5667

In firefox also you can do the same thing.

  1. Create one firefox profile
  2. Change the firefox download setting as it should save files without asking about location to save
  3. Launch the automation using that profile.

FirefoxProfile profile = new FirefoxProfile(profileDir);

driver=new FirefoxDriver(profile);

below you can see how to change firefox file download settings

enter image description here

And then by using by some programming language you can do remaining things

Upvotes: 0

Related Questions