Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
no action on click for particular wpf button
#1
Not Solved
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.
Reply
#2
Not Solved
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


Attached Files Image(s)
   
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
MyBB how can i automatically click ok button in msgbox popup test 11 24,020 07-12-2022, 11:50 PM
Last Post: akash warke
  Help for instruction to click on Skip button in the warning message vijilesh 0 1,354 09-16-2018, 03:48 PM
Last Post: vijilesh
  Issue in QTP WPF vimal_selvam 5 13,920 06-26-2018, 05:40 PM
Last Post: rateebhatt
  UFT 14.01 - identifying wpf objects. but not performing action. chinmoyee 1 2,348 11-15-2017, 03:42 PM
Last Post: Ankur
  [UFT] [WPF] Verify if the cell contains an image robertosalemi 0 1,778 10-25-2016, 06:57 PM
Last Post: robertosalemi

Forum Jump:


Users browsing this thread: 2 Guest(s)