Keypress for going backward and forward in browser

Keypress for going backward and forward in browser

Home Forums Ask Expert Keypress for going backward and forward in browser

  • This topic has 10 replies, 2 voices, and was last updated 5 years ago by Haydar Can Güngör.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #32603
    Haydar Can Güngör
    Participant

      Hello,

      I try to go backward and forward in the browser with these short commands in my script:
      zap.Keyboard.KeyDown zap.Keys.Alt
      zap.Keyboard.KeyPress(37) ‘Backward
      zap.Keyboard.KeyUp zap.Keys.Alt

      zap.Keyboard.KeyDown zap.Keys.Alt
      zap.Keyboard.KeyPress(39) ‘Forward
      zap.Keyboard.KeyUp zap.Keys.Alt

      if i press “ALT” + “Left Cursor arrow” or “ALT” + “Right Cursor arrow” it works.
      But if i use this Code in my Script it does nothing… Do i have a logical mistake in my Code or what is here the Problem?

      Best Regards
      Guengoha

      #32604
      Sergey ZAP
      Keymaster

        Hello Guengoha,

        Your code is correct.
        Please make sure the browser window is in focus when you execute these steps.
        1. Activate Window property of your application object must be TRUE.
        2. Include step to check for an object in the browser page first (this will bring your browser window in focus).

        Attachments:
        #32605
        Haydar Can Güngör
        Participant

          Hello Sergey,

          i checked both of them but it still doesn’t work for me.. i don’t get any errors it just don’t go backward..

          in the screenshot below you can see that the refresh and the backward step “worked” but it’s only the refresh step which worked for me.

          Do you have any idea what the problem could be?

          Regards Guengoha

          Attachments:
          #32607
          Sergey ZAP
          Keymaster

            Hello Guengoha,
            1. The KEY steps always report passed status.
            2. In step 17 it looks like ZAPTEST finds “Login” object on the Homepage. You need to use an object that belongs to Login page only.

            #32622
            Haydar Can Güngör
            Participant

              Hello,

              i still don’t have a solution for this problem. I tested some things out and now do i think that the “ALT”-Key from my Zaptest script doesn’t work. It propably doesn’t Press the Alt-Key like i press it manually on my Keyboard. Do you have any Solutions for this problem?

              i already checked that Zaptest has the focus on my Browser but it didn’t helped..

              Regards
              Guengoha

              #32623
              Sergey ZAP
              Keymaster

                Hello Guengoha,
                Please launch ZAPTEST as administrator, and try again.

                #32624
                Haydar Can Güngör
                Participant

                  Hello SergeyP,

                  i already launched ZAPTEST as administrator, didn’t work for me.

                  Regards
                  Guengoha

                  #32627
                  Sergey ZAP
                  Keymaster

                    Hello Guengoha,
                    Please run the attached test and post results file.
                    It checks some special keys access.

                    Attachments:
                    #32628
                    Haydar Can Güngör
                    Participant

                      Hello SergeyP,

                      Okay i think the problem here is, that Zaptest presses Alt Gr instead of the Alt Key.

                      Do you know how to change this? because Alt gr and Alt is both with key number 18..

                      Regards Guengoha

                      #32629
                      Sergey ZAP
                      Keymaster

                        Please try Key Code: 57362
                        This is Left Alt key.

                        zap.Keyboard.KeyPress 57362

                        #32630
                        Haydar Can Güngör
                        Participant

                          It worked! Thanks a lot!

                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.

                        Virtual Expert

                        ZAPTEST

                        ZAPTEST Logo