Wpf tests interaction with Web type tests

2 posts, 0 answers
  1. kullboys
    kullboys avatar
    1 posts
    Member since:
    Oct 2018

    Posted 01 Oct 2018 Link to this post

    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?
  2. Nikolai
    Nikolai avatar
    111 posts

    Posted 04 Oct 2018 Link to this post


    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.

    Progress Telerik 
Back to Top