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

How to programmatically set executionTimeout

2 Answers 129 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kwee
Top achievements
Rank 1
kwee asked on 10 May 2012, 05:30 AM
I am using the latest Telerik Testing Framework 2012.1.411.

I have posted a thread called "Testcases ignores executionTimeout in app.config" yesterday.
It seeks to extend the executionTimeout of long running testcases beyond the default
30min, by using the executionTimeout setting in app.config.

If that is not possible or problematic, this is a complementary thread.

In a testcase's TestInitialize function, we can do the following
   ...
   Settings settings = GetSettings();
   settings.Web.EnableSilverlight = true;
   ...

to set the EnbleSilverlight property.

Is there a similar way to programmatically set the ExecutionTimeout?

Currently, settings.Web.ExecutionTimeout and settings.ExecutionTimeout do not exist and the code
cannot be compiled.

Maybe, there is a way that I am not aware of?

Thanks,

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 14 May 2012, 01:42 PM
Hi Kwee,

You can set the test 'Timeout' as an attribute of a test using the following code:
[TestMethod(), Timeout(80)]
public void MyTestMethod()
{
    // test code
}

Also, check out this MSDN article on how to 'Set Time Limits for Running Tests'.  

Kind regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
kwee
Top achievements
Rank 1
answered on 14 May 2012, 04:35 PM
Great! This will come in handy.
Tags
General Discussions
Asked by
kwee
Top achievements
Rank 1
Answers by
Plamen
Telerik team
kwee
Top achievements
Rank 1
Share this question
or