state of object changing after click action
Hi,
I am trying to automate a test case for web testing in Test Complete where i have to click on a series of tabs and read the data from the grid(for each tab)
I am initially creating the tab object and getting the count of tab's to loop through as follows:-
var view = Aliases.browser.pageAfsDataDiscovery.formForm1.Panel(2).Panel(1).Table("dxsplitter1").Cell(2, 0).Panel("dxsplitter1_1_CC").Panel(0).Panel(0).Panel("tabView");
var view_cnt = view.getElementsByClassName("dxtc-link").length;
I am later trying to loop through the count of views(tabs) and click on the tab and then read the tab name as follows:-
for(i=0;i< view_cnt; i++)
{
var view_name = view.getElementsByClassName("dxtc-link");
var view_id = view_name_temp.item(i).id;
var vw_cmd = 'Sys.Browser("iexplore").Page("https://testwebsite.aspx").Form("form1").FindChild("Name",\'Link("' + view_id + '")\',99).Click()' --- Click n the tab
eval(vw_cmd)
var vw_name = view_name.Item(i).innerText; -- Get the display name of the tab
}
The issue i am facing is once i click the view(tab) and then use the object var view_name to get the display name of the tab it is returning a NULL value.This is because after the click on the tab (to select the tab) the state of the
object variables view and view_name which were created earlier changes(a lot of attributes and properies no longer exists or becomes NULL)
I am not sure why the state of objects are changing after the click.Just for argument sake if you consider the first tab i was already on the first tab by default when i stored the values of view and view_cnt initially and i am again just clicking on the
first tab for i=0 in the loop,so nothing really changed in the UI
Is there any way to resolve this issue?Any pointers appreciated?
Regards,
Shailesh