July 20, 2018, 02:43:09 AM

Author Topic: The button is not visible it cannot be activated error in UiSpec4j  (Read 1664 times)

uispec

  • Guest
I am new to UiSpec4j framework and right now facing some issue with it to write a testcase. Whenever I try to execute the testcase I get the error message as "The button is not visible, it cannot be activated". Can someone tell me how to resolve this problem?




Offline infomaniac

  • Administrator
  • Full Member
  • *****
  • Thank You
  • -Given:
  • -Receive:
  • Posts: 173
  • Karma: +0/-0
    • View Profile
    • Poke This Member
I guess the error itself makes it self-explanatory - "The button is not visible it cannot be activated" which means that the button which you are trying to get for eg. getMainWindow().getButton("buttonName").triggerClick(); is not visible in the main application which you are testing. For eg. if the button is named as "Save" and it does the save action. Probably in your code when you are executing the triggerClick to the button it is not visible which means it has executed saveButton.isVisible(false) and it's not visible.

So, you need to make sure that the button i.e saveButton.isVisible(true) when executing the triggerClick() on UiSpec4j test code. The best thing to check this is follow your test code and try to execute the steps manually with the application and figure out the visibility problem with the button and correct it in the code which should allow you to use it without any issues.

One important thing to note: If your application deals with lot of dynamic visibility changes, then make sure you use one getMainWindow() for the each panel or component in your application when doing the setup(). For eg,

Window window = getMainWindow();

Use the window throughout accessing your application which deals with dynamic visibility changes as it will load the constructor every time you hit the getMainWindow() separately which might cause this error as well.

Find out the attached pdfs which talks about some basics of using the UISpec4j framework for testing!
« Last Edit: June 19, 2014, 12:08:11 PM by infomaniac »

 
Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 
Copyrights © InfoManiac

Related Posts Plugin for WordPress, Blogger...