private void PostSalesOrder(UserContext userContext, ClientLogicalForm newSalesOrderPage) { ClientLogicalForm postConfirmationDialog; using (new TestTransaction(TestContext, "Post")) { postConfirmationDialog = newSalesOrderPage.Action("Post...").InvokeCatchDialog(); } if (postConfirmationDialog == null) { userContext.ValidateForm(newSalesOrderPage); Assert.Inconclusive("Post dialog can't be found"); } ClientLogicalForm openPostedInvoiceDialog; using (new TestTransaction(TestContext, "ConfirmShipAndInvoice")) { openPostedInvoiceDialog = userContext.CatchDialog(postConfirmationDialog.Action("OK").Invoke); } ClientLogicalForm postedInvoicePage; using (new TestTransaction(TestContext, "OpenPostedInvoice")) { if (openPostedInvoiceDialog != null) { postedInvoicePage = userContext.CatchForm(openPostedInvoiceDialog.Action("Yes").Invoke); var newSalesInvoiceNo = postedInvoicePage.Control("No.").StringValue; TestContext.WriteLine("Posted Sales Invoice No. {0}", newSalesInvoiceNo); TestScenario.ClosePage(TestContext, userContext, postedInvoicePage); } } }