I want to extract some coded steps from my test to use it by different tests. These coded steps work with variables defined in test and these variables are different in different test.
I want to extract CodedStep to separate test, but how I could pass variable '
I only guess to do it like
but I need to pass testname to this separate test.
Please suggest.
// define variable
public
static
string
accountEmailDomain = DateTime.Now.ToString(
"yyMMddHHmmss"
) +
".com"
;
// use it in code
[CodedStep(
"Enter text in 'Account_EmailDomain'"
)]
public
void
Fill_AccountEmailDomain1()
{
Pages.AccountWindow.FrameContentIFrame.Account_Emaildomain.MouseClick();
Manager.Desktop.KeyBoard.TypeText(accountEmailDomain, 50, 100);
}
accountEmailDomain
' from current running test?I only guess to do it like
// use it in separate test
[CodedStep(
"Enter text in 'Account_EmailDomain'"
)]
public
void
Fill_AccountEmailDomain1()
{
Pages.AccountWindow.FrameContentIFrame.Account_Emaildomain.MouseClick();
Manager.Desktop.KeyBoard.TypeText(Test1.accountEmailDomain, 50, 100);
}
Please suggest.