I have some code in Action1 item. I have added Action2 where I want to store some common function but if I call it from Action1, it does not work. I just want to create some "global ac开发者_开发知识库tions" that will be reusable. Thanks
May be having a "Function library" and have your functions defined there would be easier.
For modular reuse with QTP, your options are:
- Use function libraries (as @Vikas noted)
- Use reusable Actions
If you are going to use actions, then each action should itself be modular. Whatever piece of code you want to be reused should be a whole Action unto itself, not part of another action.
精彩评论