This is a migrated thread and some comments may be shown as answers.

switching which host a set of API tests run against

1 Answer 33 Views
Windows
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 03 Aug 2017, 09:40 PM

What is the best way to do this?

 

We can't easily edit an existing test case in the UI (you can look at the baseline but AFAIK you can't edit it without either hacking the file or executing/re-composing/adding back to API test list.

And even if we could edit them directly, I want to simply switch the host for all the Uris selected for the arrSess[ ] session list.

How do I choose theHost in a dynamic, UI-prompted way? All I have been able to do is a know in custom rules I can do something like this:

 

BeforeTestList(arrSess: Session[]): boolean
{
    // How do I choose theHost from a popup/form of choices? All I figured out is a simple message box, nothing rich:

    MessageBox.Show("Run Tests" + arrSess.Length.ToString() + " tests.", "BeforeTestList", );

    for (var i: int=0; i<arrSess.Length; i++)
    {
        arrSess[i].host = theHost;
     }

}

Let's say I want to pick it from a short dropdown or radio button list.

I tried using a Windows Form but it seems that the context under which jscript.net executes in Fiddler is somewhat protected and it doesn't seem to want to let me use those classes.

 

Can someone post a small example of how you would dynamically choose the host to run your list of sessions against when you do 'Run selected tests' in the API test tab?

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 08 Aug 2017, 04:00 PM
Hi,

You can create a standard Form class, containing the controls you want and then show it in the BeforeTestList method. Keep in mind that you can use both JScript.NET and C#.

Regards,
Alexander
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Windows
Asked by
Ed
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or