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
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.