jsc
12 years agoRegular Contributor
Assigning mapped objects to variables
Hi all,
I am generating a generic script and for better handling I want to assign the rather awkward namemappings to variables and work with them.
Unfortunately I failed completely and didn't find the proper site in http://support.smartbear.com/viewarticle/11508/.
So I got 2 questions on this.
My initial script is like this, I am using Jscript:
1)
function test()
{
Aliases.Genesis.FContainerFormGenesis.TWCAxFrameSDK.ToolbarButtonNew.Click(52, 15, 0);
Aliases.Genesis.FContainerFormGenesis.TWCAxFrameSDK.AdvDockPanelMain.ToolBarSpeedBar.PopupMenu.Click(5);
}
I tried to assign the mapped objects to variables and work with them, like:
2)
function test()
{
var NewButton = Aliases.Genesis.FContainerFormGenesis.TWCAxFrameSDK.ToolbarButtonNew;
var NewPopupMenu = Aliases.Genesis.FContainerFormGenesis.TWCAxFrameSDK.AdvDockPanelMain.ToolBarSpeedBar.PopupMenu;
NewButton.Click(52, 15, 0);
NewPopupMenu.Click(5);
}
My questions:
1. calling script 1) from keyword test is working. running this script directly from the scripts via "run current routine" doesn't work - why? (test finishes green without executing the actions (opening popup and clicking element 5).
2. calling script 2) from keyword tests makes testcomplete hang completely and has to be terminated via task manager. can't I assign the name mappings like this? How do I have to do it?
Thanks a lot in advance,
Joachim
I am generating a generic script and for better handling I want to assign the rather awkward namemappings to variables and work with them.
Unfortunately I failed completely and didn't find the proper site in http://support.smartbear.com/viewarticle/11508/.
So I got 2 questions on this.
My initial script is like this, I am using Jscript:
1)
function test()
{
Aliases.Genesis.FContainerFormGenesis.TWCAxFrameSDK.ToolbarButtonNew.Click(52, 15, 0);
Aliases.Genesis.FContainerFormGenesis.TWCAxFrameSDK.AdvDockPanelMain.ToolBarSpeedBar.PopupMenu.Click(5);
}
I tried to assign the mapped objects to variables and work with them, like:
2)
function test()
{
var NewButton = Aliases.Genesis.FContainerFormGenesis.TWCAxFrameSDK.ToolbarButtonNew;
var NewPopupMenu = Aliases.Genesis.FContainerFormGenesis.TWCAxFrameSDK.AdvDockPanelMain.ToolBarSpeedBar.PopupMenu;
NewButton.Click(52, 15, 0);
NewPopupMenu.Click(5);
}
My questions:
1. calling script 1) from keyword test is working. running this script directly from the scripts via "run current routine" doesn't work - why? (test finishes green without executing the actions (opening popup and clicking element 5).
2. calling script 2) from keyword tests makes testcomplete hang completely and has to be terminated via task manager. can't I assign the name mappings like this? How do I have to do it?
Thanks a lot in advance,
Joachim