0
votes

We have several actions across various custom screens that create entities and then redirect to them. I can't seem to figure out how to capture what the new entity that was created is and do anything with it when an action is called in the testing sdk.

Is the test framework capable of handling redirects in long running operations? If so, how do you deal with them? Is it possible to capture the new object that was created? I am able to verify that the long running operations was successful or if it errors, but then it fails trying to access the action because the page redirected and it is no longer in the UI. As you can see in the screenshots, I push the CreateJob action which then kicks off a long running operation which eventually redirects to the job that was created.

#region Step 1: Create Base Quote
        using (TestExecution.CreateTestCaseGroup("Step 1: Create Base Quote"))
        {
            Quote quote = new Quote();
            quote.OpenScreen(true);
            quote.Insert();
            quote.Summary.BAccountID.Select("0000467");
            quote.Summary.OpportunityName.Type("UAT Test");

            quote.Products.New();
            quote.Products.Row.InventoryID.Select("P46");
            quote.Products.Row.Quantity.Type(5000);
            quote.Products.Row.CuryUnitPrice.Type(0.03);

            quote.Save();

            quote.CreateJob();

            quote.VerifyLongOperation(quote.CreateJob, true);


        }
        #endregion

enter image description here

1

1 Answers

0
votes

Here is some code from the SDK that I think should pertain to your issue. If you add the correct WaitAction to the process in the extension constructor then you should be able to pick up with the correct object once it's done.

public JournalEntry()
{
     Details.ToolBar.ViewDocument.WaitAction = delegate
    {
        Wait.WaitForNewWindowToOpen();
        Wait.WaitForPageToLoad();
    }
}
...
JournalEntry JournalEntry = new JournalEntry();
JournalEntry.OpenScreen();
JournalEntry.Summary.Module.Select("AP");
JournalEntry.Last();
JournalEntry.Details.ViewDocument();

Bill Bill = new Bill();
Bill.Cancel();
Bill.CloseWindow();