Micro Focus QTP (UFT) Forums

Full Version: Use same Action with different parent window
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!
I have in my application a customer dialog. This dialog will be call with different parents in my application.

For example:
Code:
a)
[b]Window("ApplicationName").[/b]Window("Customer").WinEdit("Name").Set "X"
b)
Window("Customer").WinEdit("Name").Set "X"

I will always use the same CustomerAction, so is there a simple way how i can do this?
Another question: Can i use the same Object Repository hierarchy - that all items in the customer-dialog are present only once!?

Thanks!
Hi,

Use descriptive programming here to identify win edit box and then enter teh value,
his will resolve your issue.
Try only b option everywhere, it should work if we omit middle windows hierarchy.
Quote:I will always use the same CustomerAction, so is there a simple way how i can do this?
If you meant , you dont like writing the same thing again and again,set it to an object

Code:
set Customer= Window("Customer").WinEdit("Name")

Now accordingly which parent window opens this window, you can write code as

Code:
Window("ParentName").Customer.Set "X"