| || |
More than 100 objects on a web page, how can I reduce the length of the script??
Application on which we are doing an Automation using QTP has a web page with nearly 40 checkboxes and 20 textBoxes and few buttons.
I am not getting a smarter way to prepare a script for it. Which approch shall I go with???
We are using Hybrid framework(keyword+DD), Shall I pass a value for each checkbox (to check I am sending "C" and to uncheck sending "UC" a parameter)??
Please help me out to reduce the length of the script and really dont want to deal with more than 100 parameters for a single script.
Note : we are not using DP as of now. Using hybrid framework(K+DD).
Perhaps you can define a new function to check/uncheck all the checkbox using the function. Similarly you can develop function for textbox too.
Note: As you said that you are not using descriptive approach hope you have everything in repository or passing as parameter.
Syntax - (ObjectName/ObjectParameter) Multichkboxclick (Condition)
Scenario: need to check/uncheck 40 chkbox all of them added in object repository.
parameter can be passed as (chkboxname1;chkboxname1;chkboxname1;....) multichkboxclick ("C;UC;UC;C;C;........"), Split the parameter with ";"
Thanks Venu.... Will try it the way you are suggesting.... If any hurdle occurs in middle will let you know.....
What is the goal of the test? Is it to see if each one can be checked and unchecked? Perhaps use .childobject and collect all of the objects on the screen that are checkboxes. Then toggle each and see that they can go to the correct checked state.
Accessing the objects via their index and using a For/Next loop might reduce the script size.
use br.pg.childobjects(desp) - get the childobjects of the desired type and action(check/uncheck) by looping through all the objects