Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Is It Possible to Type or Enter a Tab Key in SOATest?

Speedy993
Speedy993 Posts: 72

I have a SOATest (2021.2) test that I want to enter or type the tab key a few times to give focus to a particular element in a web app instead of selecting or typing a value in it. I have not been able to find anything about that except in a very old post for SOATest 6.2 which involved adding script to a javascript file in the SOATest installation. Is there a way to enter special key combinations in a SOATest test of a web application?
Thanks!

Tagged:

Answers

  • tony
    tony Posts: 33 ✭✭

    Yes, you can enter tabs during playback. Just use a "Type" action and for the Text Input paste however many tabs you want to play back. You cannot directly type a tab into the Text Input field because it will cause the cursor to move to another field, so you will have to copy the tab character from somewhere else and then paste it into the Text Input field.

    Using tabs to change focus might be difficult to maintain if intermediate elements get added to or removed from the tab sequence. You way want to instead use a click action to click the element (which also causes it to gain focus) or using an Execute JavaScript command such as the following to give the element focus:

    function focus(element) {
        element.focus();
    }
    
  • Speedy993
    Speedy993 Posts: 72

    I found a website that had the tab character that I was able to copy and use the Type command to enter it into the text field. Here is the url: https://wiki.c2.com/?CopyAndPasteTabs
    Thanks!

Tagged