Forum Discussion
chicks
15 years agoRegular Contributor
Robert, Bert, thanks for your responses.
I have taken the time to review the webinar again and found it more interesting this time around. It seems like the namespace mapping does have numerous options for being flexible in getting a handle on an object. I can see where the conditional mapping will help me solve my modal dialog problems (they're appearing differently on different versions of the browser). I suppose I can mix name space mapping for the objects that require a condition and regular hierarchical identification the rest of the time.
Robert, when do you decide to use name space mapping and when do you go with another approach?
Bert, can you expand on your JScript library idea please?
My co-worker is experimenting with a script to find all objects on a page and map them to shorter variable names, similar to the QTP
object repository concept. As I understand it, we will go through and run this as an initial step; and then run our regular scripts.
This seems like a combination of the Test Complete Namespace mapping (with less flexibility in object recognition) and alias concepts.
For those of you with enough time, I've included a code snippet before showing how I'm currently referencing objects for your comments.
I'm 'folding up' the reference by creating intermediate variables, so that the path in the check property is minimized, in this case
currPage \ transaction panel \ 'row in the table'. There's a picture attached.
========================================================
function checkOfferDetailsInAccountOverview(whatRow,expectedOfferName,expectedReward,expectedOfferType)
{
// NO NAVIGATION
var currPage = Sys.Process("iexplore", iexploreNum).Page("*");
// for account overview, only the most recent month is shown, we don't have an extra panel
// for the separate months
var transaction_panel = currPage.Panel(0).Panel("content").Panel(1).Panel(0).Form("recentactivity").Panel(0).Panel(2).Panel(1).Panel(0);
// hover mouse not needed for script.... but makes action visible
transaction_panel.Table(0).Cell(whatRow, 2).HoverMouse();
// verify offer details section exists with headers
aqObject.CheckProperty(transaction_panel.Table(0).Cell(whatRow, 2).Panel(0).Panel(2), "innerText", cmpContains, "OFFER DETAILS\r\nOFFER NAMEREWARD EARNEDOFFER TYPE");
// verify specific offer details IS CONTAINED IN THE PANEL
aqObject.CheckProperty(transaction_panel.Table(0).Cell(whatRow, 2).Panel(0).Panel(2), "innerText", cmpContains, expectedOfferName+expectedReward+expectedOfferType);
I have taken the time to review the webinar again and found it more interesting this time around. It seems like the namespace mapping does have numerous options for being flexible in getting a handle on an object. I can see where the conditional mapping will help me solve my modal dialog problems (they're appearing differently on different versions of the browser). I suppose I can mix name space mapping for the objects that require a condition and regular hierarchical identification the rest of the time.
Robert, when do you decide to use name space mapping and when do you go with another approach?
Bert, can you expand on your JScript library idea please?
My co-worker is experimenting with a script to find all objects on a page and map them to shorter variable names, similar to the QTP
object repository concept. As I understand it, we will go through and run this as an initial step; and then run our regular scripts.
This seems like a combination of the Test Complete Namespace mapping (with less flexibility in object recognition) and alias concepts.
For those of you with enough time, I've included a code snippet before showing how I'm currently referencing objects for your comments.
I'm 'folding up' the reference by creating intermediate variables, so that the path in the check property is minimized, in this case
currPage \ transaction panel \ 'row in the table'. There's a picture attached.
========================================================
function checkOfferDetailsInAccountOverview(whatRow,expectedOfferName,expectedReward,expectedOfferType)
{
// NO NAVIGATION
var currPage = Sys.Process("iexplore", iexploreNum).Page("*");
// for account overview, only the most recent month is shown, we don't have an extra panel
// for the separate months
var transaction_panel = currPage.Panel(0).Panel("content").Panel(1).Panel(0).Form("recentactivity").Panel(0).Panel(2).Panel(1).Panel(0);
// hover mouse not needed for script.... but makes action visible
transaction_panel.Table(0).Cell(whatRow, 2).HoverMouse();
// verify offer details section exists with headers
aqObject.CheckProperty(transaction_panel.Table(0).Cell(whatRow, 2).Panel(0).Panel(2), "innerText", cmpContains, "OFFER DETAILS\r\nOFFER NAMEREWARD EARNEDOFFER TYPE");
// verify specific offer details IS CONTAINED IN THE PANEL
aqObject.CheckProperty(transaction_panel.Table(0).Cell(whatRow, 2).Panel(0).Panel(2), "innerText", cmpContains, expectedOfferName+expectedReward+expectedOfferType);