Results 1 to 6 of 6
  1. #1

    PushButton class

    I am having clicking on a push button in dialogbox, Silk test keeps giving the message that the button is n ot enabled. However, It is visually enabled. How do I use click () if it says it's not enabled. What other method i can try to make sure it clicks on it. I have tried IsVisible, IsPressed, IsExists but can't click on it. Please help!

  2. #2

    Re: PushButton class

    hi try this


  3. #3

    Re: PushButton class


    Did you try setting the pushbutton to focus and then typing enter?

    It might be worth a try:
    <font class="small">Code:</font><hr /><pre>
    [ ] wPushButton.SetFocus ()
    [ ] wPushButton.TypeKeys ("&lt;enter&gt;")
    </pre><hr />


  4. #4

    Re: PushButton class

    Add the following line before the statement that clicks the button.


    It works fine.
    but it's not recommended.

    we have to set the focus first. then u can click it
    Krishna Chaitanya

    Try and fail, but don't fail to try

  5. #5

    Re: PushButton class

    Thank you so much.

  6. #6

    Re: PushButton class


    Just an addition to Krishna's comment... After you do your Click () thing on the button, revert your option back...
    <font class="small">Code:</font><hr /><pre>
    btn.Click ()
    Agent.SetOption (OPT_VERIFY_ENABLED, TRUE)
    </pre><hr />

    Just a suggestion!


    I would not use tat method since you are sending your script into a potential infinite loop. If your button (or control you are waiting for) will never get enabled, your script will never finish running.

    If you want to wait, I would recommend waiting for a certain amount of time. To accomplish that, do something along the lines of this:
    <font class="small">Code:</font><hr /><pre>
    boolean WaitForControl (AnyWin ctrl, int timeout)
    int i
    boolean bRetVal = false
    for i = 1 to timeout
    if (ctrl.IsEnabled ())
    bRetVal = true
    sleep (1)

    return bRetVal
    </pre><hr />

    Hope this helps.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:56 PM.

Copyright BetaSoft Inc.