mesg2anil
14 years agoRegular Contributor
How to modify the object names in the VB script during execution
Hi,
While executing the VB script in TC, when I insert a new row in the web application, below will be the path and the object...
Sys.Process("iexplore").Page("http://server/Default.asp").document.frames.Frame("mainFrame").document.all.Item("gdvDepositDetails_ctl02_ddlDepositType")
Sys.Process("iexplore").Page("http://server/Default.asp").document.frames.Frame("mainFrame").document.all.Item("gdvDepositDetails_ctl02_ddlDepositRefundable")
after entering the data in the above objects in the application, I click to add one more new row, object name will change a little as below...
Item("gdvDepositDetails_ctl03_ddlDepositType") 'only thing changes here is numeric digit 3, above in the first row object name it is 2
Item("gdvDepositDetails_ctl03_ddlDepositRefundable")
In the first row, the object name contains ct102 and second row will be ctl03, similarly number keep increasing as I add more rows... So, in this situation, if I want to use IF condition or FOR loop to input the data without mentioning object name and just change the numeric digit, how can I change ctl02 to ctl03 and input the data into the object in the application?
I might add just 1 row or sometimes I might add 4 or sometimes 10 rows, so for that reason it will be difficult to know how many rows I'm going to add as it depends on the data I need to input. How to handle this kind of situation in TC??
While executing the VB script in TC, when I insert a new row in the web application, below will be the path and the object...
Sys.Process("iexplore").Page("http://server/Default.asp").document.frames.Frame("mainFrame").document.all.Item("gdvDepositDetails_ctl02_ddlDepositType")
Sys.Process("iexplore").Page("http://server/Default.asp").document.frames.Frame("mainFrame").document.all.Item("gdvDepositDetails_ctl02_ddlDepositRefundable")
after entering the data in the above objects in the application, I click to add one more new row, object name will change a little as below...
Item("gdvDepositDetails_ctl03_ddlDepositType") 'only thing changes here is numeric digit 3, above in the first row object name it is 2
Item("gdvDepositDetails_ctl03_ddlDepositRefundable")
In the first row, the object name contains ct102 and second row will be ctl03, similarly number keep increasing as I add more rows... So, in this situation, if I want to use IF condition or FOR loop to input the data without mentioning object name and just change the numeric digit, how can I change ctl02 to ctl03 and input the data into the object in the application?
I might add just 1 row or sometimes I might add 4 or sometimes 10 rows, so for that reason it will be difficult to know how many rows I'm going to add as it depends on the data I need to input. How to handle this kind of situation in TC??