Bharadwaj
11 years agoContributor
Accessing the controls on the web page
Hi Guys,
I want to access controls on the web page. For example I have a developer express grid control on the web page which displays the user information. It has information as follows
Invoice # Product Total
1 Car 100000
2 Misc 1000
Now when the scan this page using test complete object explorer tool,I find its idStr attribute in the object browser as say paxtabs_vol_grid_invoce
Now coming to my main point of accessing this grid object, I am doing it in the following two ways :
Approach 1 : Use the object browser and scan the idString attribute and use it in my code to access the grid object.
Approach 2 : Use the contents of the grid headers(in my case Invoice # or Product or Total),get the object in which they reside and then get the parent of that objct which in our case is the grid object and then access it the way I want.
Problem with Approach 1 :
The hard coded idString attriute in my Approach 1 keeps on changing whenever I upgrade my developers express. So every time I upgrade the developer express I have to rescan the grid and then get the new IdString attribute value of the grid and then replace it in my test scripts to work. This is hectic as it increases my maintenance.
Problem with Approach 2 :
My grid header values or the data values in the grid are not always consistent as the developers keep on changing them,so whene ever they change the header labels again I need to go to my code and update it with the latest lable name to get the object in which it resides or else it wont find the old lable name any where on the page and my script will fail.
Can any one please suggest me a better approach where my maintenance will be minimum. Thanks in advance.
Regards,
Bharadwaj.
I want to access controls on the web page. For example I have a developer express grid control on the web page which displays the user information. It has information as follows
Invoice # Product Total
1 Car 100000
2 Misc 1000
Now when the scan this page using test complete object explorer tool,I find its idStr attribute in the object browser as say paxtabs_vol_grid_invoce
Now coming to my main point of accessing this grid object, I am doing it in the following two ways :
Approach 1 : Use the object browser and scan the idString attribute and use it in my code to access the grid object.
Approach 2 : Use the contents of the grid headers(in my case Invoice # or Product or Total),get the object in which they reside and then get the parent of that objct which in our case is the grid object and then access it the way I want.
Problem with Approach 1 :
The hard coded idString attriute in my Approach 1 keeps on changing whenever I upgrade my developers express. So every time I upgrade the developer express I have to rescan the grid and then get the new IdString attribute value of the grid and then replace it in my test scripts to work. This is hectic as it increases my maintenance.
Problem with Approach 2 :
My grid header values or the data values in the grid are not always consistent as the developers keep on changing them,so whene ever they change the header labels again I need to go to my code and update it with the latest lable name to get the object in which it resides or else it wont find the old lable name any where on the page and my script will fail.
Can any one please suggest me a better approach where my maintenance will be minimum. Thanks in advance.
Regards,
Bharadwaj.