02-28-2011, 10:55 PM
In most cases BC will be used to call functions in a global script (keyword driven). That is how I do it as well whenever possible. Sometimes there are actions that need to happen before calling the global function, maybe a validation or an error handling (scripted).
I handle all possibilities in my BC/scripts. i do not depend on the Process person to understand or know anything about QTP. I try to keep it as simple as..if they need to click a button use the Click BC and give me an identifier(text, id, name, etc)as a parameter to find in the application (click "OK"). Sometimes that can be tricky depending on your application, but so far I haven't found a situation in my apps that can't be handled.
To use strictly the global scripts requires a developer to make a "driver"(a script that executes the functions). BC uses Quality Center as the "driver" and executes the BCs in specified order.
A few words of wisdom:
I have completely stopped using the OR in favor of Descriptive Programming(DP). I did start off using the OR while learning QTP, but eventually found it more of a limitation than anything.
Keep the BCs simple. If you need to create a textbox BC, then just do that. If the textbox is call First Name, you can create a BC call FirstName that only populates that box on the form. I found it more useful to create a SetTextBox BC and pass in the Object name (FirstName) and Value as parameters. That made it significantly more reusable.
Keep your users in mind. In some cases it better to create a Search BC (2 textboxes populate and click submit) than it was to use the individual BC format. If you used a framework (global sheet), then you still called the same functions, but you were able to provide a better user experience with selecting only one BC instead of 3 (if you have QC10, read about "Flow" test type too) and they can probably more easily identify calling Search than Settextbox, Settextbox, clickbutton.
I hope I have provided a little insight here. It takes some time to figure out the BC methods but in my opinion, once learned it provides a much better reusable method of testing.
I handle all possibilities in my BC/scripts. i do not depend on the Process person to understand or know anything about QTP. I try to keep it as simple as..if they need to click a button use the Click BC and give me an identifier(text, id, name, etc)as a parameter to find in the application (click "OK"). Sometimes that can be tricky depending on your application, but so far I haven't found a situation in my apps that can't be handled.
To use strictly the global scripts requires a developer to make a "driver"(a script that executes the functions). BC uses Quality Center as the "driver" and executes the BCs in specified order.
A few words of wisdom:
I have completely stopped using the OR in favor of Descriptive Programming(DP). I did start off using the OR while learning QTP, but eventually found it more of a limitation than anything.
Keep the BCs simple. If you need to create a textbox BC, then just do that. If the textbox is call First Name, you can create a BC call FirstName that only populates that box on the form. I found it more useful to create a SetTextBox BC and pass in the Object name (FirstName) and Value as parameters. That made it significantly more reusable.
Keep your users in mind. In some cases it better to create a Search BC (2 textboxes populate and click submit) than it was to use the individual BC format. If you used a framework (global sheet), then you still called the same functions, but you were able to provide a better user experience with selecting only one BC instead of 3 (if you have QC10, read about "Flow" test type too) and they can probably more easily identify calling Search than Settextbox, Settextbox, clickbutton.
I hope I have provided a little insight here. It takes some time to figure out the BC methods but in my opinion, once learned it provides a much better reusable method of testing.