no action on click for particular wpf button - 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: no action on click for particular wpf button (/Thread-no-action-on-click-for-particular-wpf-button) |
no action on click for particular wpf button - jlavrecka - 05-21-2020 Hi, I am testing windows based application written in c#. In my test I need to click on button. Action triggered in this case is some button property change e.g. By default button has text "Yes". When I click, button text changes to "No". Button is defined by devname, which is same in both cases and can be found. If I execute button.Click then test is run without error, but no actual action happens. When I check the element, I can see that in case 1 text and name of the element is "Yes" and in case 2 text and name properties change to "No". Do you have any hints what can be done to handle this test case? Thank you. RE: no action on click for particular wpf button - jlavrecka - 05-21-2020 For myself solved this like this: Click wasn't working on button itself, but click on FormItem where this button was located worked fine, though I had to define coordinates for the click - formitem has to be clicked in the place where button is located: l_xBtn_prop = WpfWindow("").WpfButton("BtnName").GetROProperty("x") l_widthBtn_prop = WpfWindow("").WpfButton("BtnName").GetROProperty("width") l_xFrm_prop = WpfWindow("").WpfObject("FormItemName").GetROProperty("x") l_heightFrm_prop = WpfWindow("").WpfObject("FormItemName").GetROProperty("height") WpfWindow("").WpfObject("FormItemName").Click (l_xBtn_prop-l_xFrm_prop)+l_widthBtn_prop/2, l_heightFrm_prop/2 |