Unable to export excel file in selenium c# code

Answered
Nagaraj Chatiri asked 3 days ago

We are facing an issue with exporting a Flexmonster report to Excel through Selenium automation.

We are using the following Selenium C# code: Here strFilePath I habe given my name to file and used as variable.

js.ExecuteScript("flexmonster.exportTo('excel', { filename: '" + strFilePath + "' })");

Issue:

  • The exportTo() method is being executed.
  • A .tmp file is created in the target folder, but the Excel (.xlsx) file is never generated.
  • No exception is thrown from the Selenium code.

Manual test:

  • If we manually click the Export to Excel button in the Flexmonster UI, the Excel file is generated successfully in the same environment.

Additional information:

  • This automation code had been working correctly until 30 June 2026.
  • Starting from 1 July 2026, the same Selenium automation code no longer generates the Excel file.
  • No changes were made to our Selenium automation code.

1 answer

Public
Maksym Diachenko Maksym Diachenko Flexmonster 2 days ago

Hello, Nagaraj,

Thank you for reaching out and providing the detailed information.

We were unable to reproduce the issue on our side. Since exporting works correctly when triggered manually through the UI, this confirms that Flexmonster's export functionality is working as expected. We have also not released any Flexmonster updates in the timeframe you mentioned (June 30 - July 1), so a change on our end is not the cause of this regression.

Given this, we suggest investigating potential changes on the Selenium side, for example, those related to the mentioned Chrome update or any auto-installed Selenium updates.

On the side of Flexmonster, it would be worth checking that the export is triggered only after the reportcomplete event has fired, to ensure the report is fully rendered before the export call is made. Also, since exports can take longer to complete for larger datasets, we suggest verifying whether the process is interrupted by a Selenium timeout. Finally, we recommend additionally debugging this issue in the browser console, since an asynchronous exception during export cannot be caught by Selenium - it would only catch if the exception is thrown synchronously during that specific call.

As a temporary workaround, we suggest downgrading the Chrome version used for the export automation.

Please let us know if our answer helped you.

Best regards,
Maksym

Please sign in or register to submit your answer