vendredi 21 août 2015

Csharp unit test for Download file dialog

I am trying to write a unit test using csharp to check if file is downloaded on click of a button. How can I find out if a download/save dialog is opened after clicking export button?

        [TestMethod]
        public void ExportMyFile()
        {
            Home.GoToFilesPage();
            CommonFiles.ViewFile(0);
            CommonFiles.ClickExport();

        //int result = CommonFiles.ClickExport();
        //Assert.AreEqual(1, result); ???
        }
public static class CommonFiles
    {

        private const string ExportButton = "exportBtn";      

        public static void ClickExport()
        {
            Driver.Click(String.Format(ExportButton));
        }
    }

Aucun commentaire:

Enregistrer un commentaire