public void TC04_VerifyErrorMessage()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC04_VerifyErrorMessage");
                FpAssetTypeSettingsPage assetTypeSettings = new FpAssetTypeSettingsPage();

                assetTypeSettings.NavigateToAssetTypeSettings();

                assetTypeSettings.btnEditAssetTypeSettings.Click();

                Thread.Sleep(500);

                assetTypeSettings.txtAvailableStations.Clear();
                assetTypeSettings.txtAvailableStations.SendKeys("abcd");
                assetTypeSettings.txtAvailableStations.SendKeys(Keys.Return);

                IWebElement element = assetTypeSettings.txtErrorMessage;

                if (element.Displayed)
                {
                    PropertiesCollection.test.Log(Status.Pass, "Validation for error message has passed");
                }
                else
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for error message has failed");
                }

                Thread.Sleep(1500);

                assetTypeSettings.txtAvailableStations.Clear();
                assetTypeSettings.txtAvailableStations.SendKeys("2");
                assetTypeSettings.btnSave.Click();
            }
            public void TC03_RemoveImage()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC03_RemoveImage");
                FpAssetTypeSettingsPage assetTypeSettings = new FpAssetTypeSettingsPage();

                assetTypeSettings.NavigateToAssetTypeSettings();

                String isImagePresent = assetTypeSettings.txtImage.Text;

                if (isImagePresent == "Yes")
                {
                    String isImageRemoved = assetTypeSettings.RemoveImage();

                    try
                    {
                        Assert.AreEqual(isImageRemoved, "No");
                        PropertiesCollection.test.Log(Status.Pass, "Removing the image is successful");
                    }
                    catch
                    {
                        PropertiesCollection.test.Log(Status.Fail, "Removing the image is not successful");
                    }
                }
                else
                {
                    PropertiesCollection.test.Log(Status.Pass, "There is no image to be removed");
                }
            }
            public void TC05_NavigateToDifferentWindowWithoutSave()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC05_NavigateToDifferentWindowWithoutSave");
                FpAssetTypeSettingsPage assetTypeSettings = new FpAssetTypeSettingsPage();
                FpSideMenus             sideMenus         = new FpSideMenus();

                assetTypeSettings.NavigateToAssetTypeSettings();

                assetTypeSettings.btnEditAssetTypeSettings.Click();

                Thread.Sleep(3000);

                assetTypeSettings.txtAvailableStations.Clear();
                assetTypeSettings.txtAvailableStations.SendKeys("3");
                assetTypeSettings.btnSave.Click();

                Thread.Sleep(5000);

                assetTypeSettings.btnEditAssetTypeSettings.Click();

                Thread.Sleep(3000);

                assetTypeSettings.txtAvailableStations.Clear();

                assetTypeSettings.txtAvailableStations.SendKeys("4");

                String mainWindow = PropertiesCollection.driver.CurrentWindowHandle;

                sideMenus.lnkStudentResults.Click();

                String childWindow = PropertiesCollection.driver.CurrentWindowHandle;

                PropertiesCollection.driver.SwitchTo().Window(childWindow);

                Thread.Sleep(5000);

                String errorText = assetTypeSettings.txtConfirmationMessage.Text;

                try
                {
                    String ExpectedErrorMessage = "Any unsaved changes will be lost. Are you sure?";
                    Assert.AreEqual(ExpectedErrorMessage, errorText);
                    PropertiesCollection.test.Log(Status.Pass, "Validation for message received when navigating to a different window without save has passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for message received when navigating to a different window without save has not passed");
                }
                assetTypeSettings.btnCancel.Click();

                PropertiesCollection.driver.SwitchTo().Window(mainWindow);

                assetTypeSettings.btnSave.Click();
            }
            public void TC02_AddImage()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC02_AddImage");
                FpAssetTypeSettingsPage assetTypeSettings = new FpAssetTypeSettingsPage();
                String IsImageAdded = assetTypeSettings.AddImage();

                try
                {
                    Assert.AreEqual(IsImageAdded, "Yes");
                    PropertiesCollection.test.Log(Status.Pass, "Adding the image is successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Adding the image is not successful");
                }
            }
            public void TC01_VerifyAssetTypeSettings()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC01_VerifyAssetTypeSettings");
                FpAssetTypeSettingsPage assetTypeSettings = new FpAssetTypeSettingsPage();

                assetTypeSettings.NavigateToAssetTypeSettings();

                shortCode                = assetTypeSettings.txtShortCode.Text;
                WebAssetTypeLong         = assetTypeSettings.txtAssetTypeLong.Text;
                WebIsHistorical          = assetTypeSettings.txtIsHistorical.Text;
                WebAvailableStationCount = assetTypeSettings.txtAvailableStationCount.Text;

                connectionString = "Data Source=" + ConfigurationManager.AppSettings["SQLServerDataSource"] + ";Initial Catalog=" + ConfigurationManager.AppSettings["SQLServerInitialCatalog"] + ";Integrated Security=" + ConfigurationManager.AppSettings["SQLServerIntegratedSecurity"] + ';';
                sqlCon           = new SqlConnection(connectionString);
                sqlCon.Open();

                query   = "select AssetTypeId,AssetTypeLong,IsHistorical From tblAssettype where AssetType = '" + shortCode + "'";
                command = new SqlCommand(query, sqlCon);
                reader  = command.ExecuteReader();

                while (reader.Read())
                {
                    assetTypeId     = reader.GetInt64(0);
                    TDAssetTypeLong = reader.GetString(1);
                    TDIsHistorical  = reader.GetBoolean(2);
                }

                reader.Close();

                query   = "select AvailableStations from tblAssetTypeSetting where AssetTypeID = '" + assetTypeId + "'";
                command = new SqlCommand(query, sqlCon);
                reader  = command.ExecuteReader();

                while (reader.Read())
                {
                    TDAvailableStationCount = reader.GetInt32(0);
                }

                reader.Close();
                sqlCon.Close();

                try
                {
                    int count = Int32.Parse(WebAvailableStationCount);
                    Assert.AreEqual(count, TDAvailableStationCount);
                    PropertiesCollection.test.Log(Status.Pass, "Validation for available station count has passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for available station count has not passed");
                }
                try
                {
                    Assert.AreEqual(TDAssetTypeLong, WebAssetTypeLong);
                    PropertiesCollection.test.Log(Status.Pass, "Validation for Asset type long name has passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for Asset type long name has not passed");
                }
                try
                {
                    bool historical;
                    if (WebIsHistorical == "Yes")
                    {
                        historical = false;
                    }
                    else
                    {
                        historical = true;
                    }
                    Assert.AreEqual(historical, TDIsHistorical);
                    PropertiesCollection.test.Log(Status.Pass, "Validation for Is historical field has passed");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for Is historical field has not passed");
                }
            }
            public void TS01_TC02_ValidateFlightProAdminMenus()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TS01_TC02_ValidateFlightProAdminMenus");

                /* Validate Strip Sub Groups Page */

                FpAdminMenus AdminMenu = new FpAdminMenus();

                AdminMenu.AdminClick();
                AdminMenu.StripSubGroupsClick();
                System.Threading.Thread.Sleep(30000);
                FpStripSubGroupsPage StripSubGroups = new FpStripSubGroupsPage();

                try
                {
                    Assert.IsTrue(StripSubGroups.Title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Strip Sub Groups Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Strip Sub Groups Page not loaded");
                    throw;
                }

                /* Validate Catalogue Administration Page */

                AdminMenu.AdminClick();
                AdminMenu.CatalogueAdministrationClick();
                System.Threading.Thread.Sleep(30000);
                FpCatalogueAdministrationPage CatalogueAdministration = new FpCatalogueAdministrationPage();

                try
                {
                    Assert.IsTrue(CatalogueAdministration.Title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Catalogue Administration Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Catalogue Administration Page not loaded");
                    throw;
                }

                /* Validate Organisation Group Settings Page */

                AdminMenu.AdminClick();
                AdminMenu.OrganisationGroupSettingsClick();
                System.Threading.Thread.Sleep(30000);
                FpOrganisationGroupSettingsPage OrganisationGroupSettings = new FpOrganisationGroupSettingsPage();

                try
                {
                    Assert.IsTrue(OrganisationGroupSettings.IsTitleDisplayed());
                    PropertiesCollection.test.Log(Status.Pass, "Organisation Group Settings Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Organisation Group Settings Page not loaded");
                    throw;
                }

                /* Validate Budget Administration Page */

                AdminMenu.AdminClick();
                AdminMenu.BudgetAdministrationClick();
                System.Threading.Thread.Sleep(30000);
                FpBudgetAdministrationPage BudgetAdministration = new FpBudgetAdministrationPage();

                try
                {
                    Assert.IsTrue(BudgetAdministration.title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Budget Administration Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Budget Administration Page not loaded");
                    throw;
                }

                /* Validate Asset Type Settings Page */

                AdminMenu.AdminClick();
                AdminMenu.AssetTypeSettingsClick();
                System.Threading.Thread.Sleep(30000);
                FpAssetTypeSettingsPage AssetTypeSettings = new FpAssetTypeSettingsPage();

                try
                {
                    Assert.IsTrue(AssetTypeSettings.title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Asset Type Settings Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Asset Type Settings Page not loaded");
                    throw;
                }

                /* Validate Asset Type Systems Page */

                System.Threading.Thread.Sleep(30000);
                AdminMenu.AdminClick();
                AdminMenu.AssetTypeSystemsClick();
                System.Threading.Thread.Sleep(30000);
                FpAssetTypeSystemsPage AssetTypeSystems = new FpAssetTypeSystemsPage();

                try
                {
                    Assert.IsTrue(AssetTypeSystems.Title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Asset Type Systems Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Asset Type Systems Page not loaded");
                    throw;
                }

                /* Validate Roster Administration Page */


                AdminMenu.AdminClick();
                AdminMenu.RosterAdministrationClick();
                System.Threading.Thread.Sleep(30000);
                FpRosterAdministrationPage RosterAdministration = new FpRosterAdministrationPage();

                try
                {
                    Assert.IsTrue(RosterAdministration.Title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Roster Administration Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Roster Administration Page not loaded");
                    throw;
                }

                /* Validate Shift Administration Page */

                AdminMenu.AdminClick();
                AdminMenu.ShiftAdministrationClick();
                System.Threading.Thread.Sleep(30000);
                FpShiftAdministrationPage ShiftAdministration = new FpShiftAdministrationPage();

                try
                {
                    Assert.IsTrue(ShiftAdministration.Title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Shift Administration Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Shift Administration Page not loaded");
                    throw;
                }

                /* Validate Templates Page */

                AdminMenu.AdminClick();
                AdminMenu.TemplatesClick();
                System.Threading.Thread.Sleep(30000);
                FpTemplatesPage Templates = new FpTemplatesPage();

                try
                {
                    Assert.IsTrue(Templates.Title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Templates Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Templates Page not loaded");
                    throw;
                }

                /* Validate Syllabi Page */

                AdminMenu.AdminClick();
                AdminMenu.SyllabiClick();
                System.Threading.Thread.Sleep(30000);
                FpSyllabiPage Syllabi = new FpSyllabiPage();

                try
                {
                    Assert.IsTrue(Syllabi.Title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Syllabi Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Syllabi Page not loaded");
                    throw;
                }

                /* Validate Courses Page */

                AdminMenu.AdminClick();
                AdminMenu.CoursesClick();
                System.Threading.Thread.Sleep(30000);
                FpCoursesPage Courses = new FpCoursesPage();

                try
                {
                    Assert.IsTrue(Courses.Title.Displayed);
                    PropertiesCollection.test.Log(Status.Pass, "Courses Page loaded");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Courses Page not loaded");
                    throw;
                }
            }