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

Wpf tests interaction with Web type tests

1 Answer 11 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kullboys
Top achievements
Rank 1
kullboys asked on 02 Oct 2018, 03:21 AM
Hello everyone
Last two days I have been recording tests on Web types and Wpf types separately
Seems like 'random name generator' is working fine in Web Type test. But is it possible to use random  â€˜DataBindVariableName’ from Web types test to Wpf Type test?
Thanks.

1 Answer, 1 is accepted

Sort by
0
Nikolai
Telerik team
answered on 04 Oct 2018, 03:13 PM
Hello,

Although TestStudio allows mixed execution of Web and Wpf tests in a single TestList, we really do not recommend such an approach.

However, since the TestList's execution context is shared you can store your variable via the test's code behind as a static value. This will allow you to reference it in the next test. For example:
1. Create a web test - Bing.tstest
2. Add a Coded Step in that web test
3. Then create a custom coded string property - MyVar: 
public class Bing : BaseWebAiiTest
    {
        public static string MyVar{ get; set;}
         
        [CodedStep(@"New Coded Step")]
        public void Bing_CodedStep()
        {
            MyVar = "Some Value";
        }

4. Then, create a Wpf test - WPFTest.tstest
5. Add a Coded Step
6. Consume the MyVar's value: 
public class WPFTest : BaseWebAiiTest
   {
       [CodedStep(@"New Coded Step")]
       public void WPFTest_CodedStep()
       {
           string value = Bing.MyVar;
       }

That being said, if you can provide us with more details on your exact scenario we can try to figure out a better way to accomplish it.

Regards,
Nikolai
Progress Telerik 
Tags
General Discussions
Asked by
kullboys
Top achievements
Rank 1
Answers by
Nikolai
Telerik team
Share this question
or