Micro Focus QTP (UFT) Forums
Use same Action with different parent window - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Use same Action with different parent window (/Thread-Use-same-Action-with-different-parent-window)



Use same Action with different parent window - Hotzi - 05-24-2011

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!


RE: Use same Action with different parent window - Tarik Sheth - 05-25-2011

Hi,

Use descriptive programming here to identify win edit box and then enter teh value,
his will resolve your issue.


RE: Use same Action with different parent window - Jay - 05-25-2011

Try only b option everywhere, it should work if we omit middle windows hierarchy.


RE: Use same Action with different parent window - rajpes - 07-06-2011

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"