Forum Discussion

m_rueckbrodt's avatar
m_rueckbrodt
Occasional Contributor
11 years ago

Button not clickable on W8

Hi,



we have an issue with a button that is clickable on W7/WS2008R2 but not on W8 systems.



On W7/WS2008 it works perfectly fine, but if we run the same test on a Win 8 system the following happens:


  • TC waits for the button (like half a second)


  • TC seems to find the button


  • TC gives a short status message "Waiting until the window is activated"


  • TC resumes to the "Playback" status and stays like that for some minutes


  • TC logs "The button was clicked with the left mouse button."


  • TC interrupts because it could execute the next test step in a subsequent window.


Even though the "was clicked" message was logged, the button was not actually clicked in the application.



We are using TC 10.4.



I found a related issue, but sadly, there was no solution to our problem.

http://smartbear.com/forums/f74/fp70/t77907/click-button-not-working-in-test-complete/



Thanks in advance.



Best regards

Matthias
  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 3 rankChampion Level 3
    Hi Matthias,



    As a workaround you may try to emulate a space key press on this button (VBScript pseudocode):

    Set button = <button>

    button.SetFocus ' this is to set focus to this button. Its caption should be in dashed box after this

    Call button.Keys(" ") ' presses the space button which should trigger the button's action



    Does this help?

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 3 rankChampion Level 3
    Hm-m-m...

    This is strange and I hope that you with Support will find the reason.

    Meanwhile, as another workaround - what if you try to perform a 'system' mouse click over the button:

    Set button = <your button>

    Call Sys.Desktop.MouseDown(VK_LBUTTON, button.ScreenLeft+5, button.ScreenTop+5)

    Call Delay(500)

    Call Sys.Desktop.MouseUp(VK_LBUTTON, button.ScreenLeft+5, button.ScreenTop+5)



    Does this work?
  • m_rueckbrodt's avatar
    m_rueckbrodt
    Occasional Contributor
    Just to add some information if someone else stumbles upon this issue in the future:



    The problem had to do with the network user policies. The testing account simply did not have the necessary rights for running the application/TC completely. 



    Thanks for the helpful responses though!



    Best regards
  • m_rueckbrodt's avatar
    m_rueckbrodt
    Occasional Contributor
    Hi Tanya,



    In this case we are testing an installer created with WiX for a .NET application.



    We already tried adding a delay and increasing the "Method invoke timeout", neither worked out for us. Even calling the function directly, separated from the rest of the test, causes the same strange issue.



    It's a simple continue button.

    TC can find it in the object browser, the name mapping and highlight it on the screen (as already said, it works perfectly fine on W7/WS2008). 

    The parent window as well as the button itself are active and enabled. 



    Best regards

    Matthias



  • m_rueckbrodt's avatar
    m_rueckbrodt
    Occasional Contributor
    Hi Alexei,



    thanks for your reply, but unfortunately it does not:



    • When I try to only set the focus, the test times out and returns the error message "The window cannot get focus." No additional information there, except for the object name.


    • When I run both the SetFocus() and Keys(" ") I simply get the same result as with ClickButton() and Click(): the test 'succeeded' and I get the log messages "The window got focus." and "Keyboard input.", but the button is still not pressed.




    Best regards,

    Matthias
  • m_rueckbrodt's avatar
    m_rueckbrodt
    Occasional Contributor
    I tried your workaround, but sadly it does not work either.

    After executing, the mouse moves to the right position, and I guess there's the click, but the button does not respond to that event at all. All that I get is an empty success log.



    Best regards

    Matthias

















  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 3 rankChampion Level 3
    Hi Matthias,



    Thank you for the update.

    Did the problem went away after TestComplete was started 'As Administrator' or you had to adjust some network policies/permissions?
  • m_rueckbrodt's avatar
    m_rueckbrodt
    Occasional Contributor
    Hi Alexei, 



    the problem was found out by starting TestComplete 'As Administrator'. 

    To solve the problem we still need to fix the specific network permissions/policies for the affected machines, but that has not been done yet.