How to test the output of excelHtml5 buttons?

How to test the output of excelHtml5 buttons?

CarstenCarsten Posts: 5Questions: 3Answers: 0

Hello,

I would like to test the output of excelHtml5 buttons, i.e. compare the returned xlsx file data to a known good file.

The only solution that I'm aware of is using Selenium with the Firefox driver configured so that it saves downloads without asking the user in a predetermined directory, then compare the downloaded and the known-good file.

I was wondering though if there is a simpler, more straightforward method to run such tests?

(Just speculating: For example, can the data just be added somewhere to the DOM, so that it would be available to the webdriver for read acces?)

Best regards,
Carsten

Answers

  • allanallan Posts: 63,573Questions: 1Answers: 10,483 Site admin

    Hi Carsten,

    Sorry for the delay in replying back here.

    For example, can the data just be added somewhere to the DOM, so that it would be available to the webdriver for read acces?

    Yes. You could use the customize callback (excelHtml5) to inspect the generated XML and do any comparison checks.

    Another option would be to add an option to have the button send the XML (as a string, so after the _addToZip() call) somewhere so it can be compared to a known good string. It is a zip file though, so any changes to the compression would break that check.

    Allan

  • CarstenCarsten Posts: 5Questions: 3Answers: 0

    Thank you very much! :)

This discussion has been closed.