/// <summary> /// Create a new, blank, form for testing purposes. To use, assign this function to a string. /// </summary> /// <returns>The ID of the newly created form.</returns> public int CreateForm() { var formData = new FormData(); var mainMenu = new MainMenu(_driver); var formMenu = new SubMenuForms(_driver); var formPages = new FormPages(_driver); // navigate to Forms > Design Forms and Packets > Create New Form _driver.SwitchToDefaultFrame(); mainMenu.ClickMainMenuTab(); mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickCreateNewForm(); _test.Log(LogStatus.Pass, "Navigate to Forms > Design Forms and Packets > Create New Form"); // click 'A blank form' _driver.SwitchToFrameById("MainContentsIFrame"); formPages.CreateNewFormPage.ClickBlankForm(); _test.Log(LogStatus.Pass, "Click 'A blank form'"); // enter form info _driver.SwitchToFrameById("tabs_Panel"); formPages.EditAndCreateFormPage.PropertiesTab.ClickStandardFormRadioButton(); formPages.EditAndCreateFormPage.PropertiesTab.FillOutFormTitle(formData.FormTitle); _test.Log(LogStatus.Pass, "Enter form information"); // save _driver.SwitchToDefaultFrame(); _driver.SwitchToFrameById("MainContentsIFrame"); formPages.EditAndCreateFormPage.ClickSaveButton(); _test.Log(LogStatus.Pass, "Save the form"); return(formPages.EditAndCreateFormPage.GetFormId()); }
public void Form_Create_New_Blank() { Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString()); var formData = new FormData(); var mainMenu = new MainMenu(Driver); var formMenu = new SubMenuForms(Driver); var formPages = new FormPages(Driver); var formWorkflow = new FormWorkflows(Driver, test); try //Contains Contents of Test { //test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLoginPage"]); // navigate to Forms > Design Forms and Packets > Create New Form mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickCreateNewForm(); test.Log(LogStatus.Pass, "Navigate to Forms > Design Forms and Packets > Create New Form"); // click 'A blank form' Driver.SwitchToFrameById("MainContentsIFrame"); formPages.CreateNewFormPage.ClickBlankForm(); test.Log(LogStatus.Pass, "Click 'A blank form'"); // enter form info Driver.SwitchToFrameById("tabs_Panel"); formPages.EditAndCreateFormPage.PropertiesTab.ClickStandardFormRadioButton(); test.Log(LogStatus.Pass, "Select the 'Standard Form' radio button"); formPages.EditAndCreateFormPage.PropertiesTab.FillOutFormTitle(formData.FormTitle); test.Log(LogStatus.Pass, "Fill out the form title"); // save Driver.SwitchToDefaultFrame(); Driver.SwitchToFrameById("MainContentsIFrame"); formPages.EditAndCreateFormPage.ClickSaveButton(); test.Log(LogStatus.Pass, "Click the save button"); var formId = formPages.EditAndCreateFormPage.GetFormId(); Console.WriteLine("Form ID: {0}", formId); // verify that the form was created Driver.SwitchToDefaultFrame(); mainMenu.ClickMainMenuTab(); mainMenu.ClickForms(); formMenu.ClickDesignFormsandPackets(); formMenu.ClickEditForms(); Driver.SwitchToFrameById("MainContentsIFrame"); Assert.IsTrue(formPages.EditFormsPage.FormExists(formId)); test.Log(LogStatus.Pass, "Verify the form exists"); // delete the form formWorkflow.DeleteForm(formId); test.Log(LogStatus.Pass, "Delete the form"); } catch (Exception e) //On Error Do { HandleException(e, Driver); throw; } }