Hi! I want to use async methods in Test Studio coded steps, but the coded step skips all async methods and everything after it and returns a successful execution of the step.
How can I solve this problem?
1 Answer, 1 is accepted
0
Nikolai
Telerik team
answered on 10 Jan 2019, 10:54 AM
Hello Ivan,
By design both Test Studio Ultimate and the underlying Telerik testing framework run synchronously. This said, you can still write and run "async" methods but you will have to wait for the the task(s) to complete. For example:
[CodedStep(@"New Coded Step")]
public void WebTest_CodedStep()
{
Task.Run(async() =>
{
var messageStatus = (await GetStatusForUri("https://bing.com")).StatusCode;