Forum Discussion
AGubarev
SmartBear Alumni (Retired)
>this would only work if your case was in a test case using the EP
what does "EP" mean?
>you can't ready the initiator of the current test
Sorry, didn't catch the idea.
So, you have an example:
The test case name : order_book_test
Steps:
1. Login
1.1. Navigate
1.2. Pass auth
2. Make order
3. Logout
Do you want something like this?
function main()
{
let scenarios = ["order_book_test", "order_glass_test"]
for (var i=0; i<scenarios.length; i++)
{
aqTestCase.Begin(scenarios[i]);
Login();
Make_Order(scenarios[i].split("_")[1]);
Logout();
aqTestCase.End();
}
}
function Login()
{
Log.AppendFolder(arguments.callee.name);
Log.Message("Navigate");
Log.Message("Pass auth");
Log.PopLogFolder();
}
function Make_Order(goods)
{
Log.AppendFolder(arguments.callee.name + ": " + goods);
Log.Message("Make order")
Log.PopLogFolder();
}
function Logout()
{
Log.AppendFolder(arguments.callee.name);
Log.Message("Logout")
Log.PopLogFolder();
}
Lee_M
3 years agoCommunity Hero
The case above is calling the test name from an array, whichever function outputs this name, it will always be correct.
I mean call the test name from a function that is not a direct descent of the parent
EP - Execution Plan
- AGubarev3 years agoSmartBear Alumni (Retired)
function main() { let scenarios = ["order_book_test", "order_glass_test"] for (var i=0; i<scenarios.length; i++) { aqTestCase.Begin(scenarios[i]); Login(); Make_Order(); Logout(); aqTestCase.End(); } } function Login() { function navigate() { Log.Error("Unable to navigate") } navigate(); Log.Message("Pass auth"); } function Make_Order(goods) { Log.Message("Make order") } function Logout() { Log.Message("Logout") } function EventControl1_OnLogError(Sender, LogParams) { Log.Warning("An error has been fired in scenario "+aqTestCase.CurrentTestCase.Name) }
Related Content
Recent Discussions
- 11 months agoRache1