Forum Discussion

JennyH11's avatar
JennyH11
Frequent Contributor
6 years ago
Solved

HScroll not working in KWTest

Hi Everyone!

 

I'm struggling to get a Horizontal Scroll to to set position using the HScroll object in a keyword test. All the others work in the test except one. The only difference is the position of the HScroll, nothing else is different from this one to the ones that work. The step DOES work when I run it on it's own but not at test run time.

 

Things I've tried:

      - Copying an HScroll step that is working and changed the position

      - Recreating a brand new operation

      - Confirmed the steps is looking at the correct object

      - Slowing the test down by adding Delays before this HScroll step

      - Putting an If Object Exists before the HScroll Object

 

As you can see I've tried quite a few things to get it working but am running low on ideas and patience! :)

 

Any tips?

 

Thanks!

Jenny

  • When you say "doesn't work", are there errors in your log or any other messages that indicate what might be going on?

     

    You seem to have gone through all the basic trial/error stuff I would have suggested.  One thing to think about... is the HScroll on screen when you run the test full speed?  I've seen somethings happen, sometimes, where if a component is not on screen, while it may LOOK like everything is working, it doesn't really work right because you can't interact with it.  

     

    Since this is a desktop application, see if there's some sort of VScroll or Page Down that you might be able to do to get the component on screen before you attempt to work with it.

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    When you say "doesn't work", are there errors in your log or any other messages that indicate what might be going on?

     

    You seem to have gone through all the basic trial/error stuff I would have suggested.  One thing to think about... is the HScroll on screen when you run the test full speed?  I've seen somethings happen, sometimes, where if a component is not on screen, while it may LOOK like everything is working, it doesn't really work right because you can't interact with it.  

     

    Since this is a desktop application, see if there's some sort of VScroll or Page Down that you might be able to do to get the component on screen before you attempt to work with it.

    • Marsha_R's avatar
      Marsha_R
      Champion Level 3

      Try putting a breakpoint in somewhere above the scroll so the test stops and then step through the test a line at a time.  Sometimes you can see things happen this way that aren't obvious when the test runs on its own.

      • JennyH11's avatar
        JennyH11
        Frequent Contributor

        Thanks Marsha!

         

        I need a bit more practise with using breakpoints, stepping through, over etc... Up until now I've only used Stop executions as I feel like I've got more control over the test. I also found that with the mouse disabled during test runs, if I pause or the test pauses because on a breakpoint, I cannot use the mouse. Therefore, I've continued to use Stops and not breakpoints as I don't want to have the mouse enabled when tests run.

         

        I presume this is how it is designed and most users do not disable the mouse and therefore do not see this issue?

    • JennyH11's avatar
      JennyH11
      Frequent Contributor

      Hi Robert!

       

      Thanks!

       

      Sorry, that was a bit vague of me. :( When I ran the test at full speed it did not move the scroll bar and it remained in the same position as it was previously to that step. So the subsequent image checkpoint was failing.

       

      I found I could get it to work if I inserted a Click on the object before I tried to interact with it. It seems a bit silly to have to do that but it makes sense, if, like you say, it isn't available to interact with yet. By clicking on it I suppose it makes it available. Though, why doesn't the HScroll behave the same way? Anyway, that's besides the point. I just don't like unneccessary test steps. :)

       

      Thanks again, all working now and I'll keep that in mind in future!