0

We are using a Javascript UI library that models a combobox as an unordered list in the HTML, e.g.

<ul>
<li>Item 1</li>
<li>Item 2</li>
...
</ul>

This is rendered like a combobox where the user clicks on it and picks from a droplist of the items. This control is not an input field, but if it has focus it does accept keystrokes and scrolls the droplist to the first item in the list that starts with the letter that is typed. This is important functionality to test.

But Truclient does not give me the option to send keystrokes to an object of this type - if I use the "Generic Object Action" the actions allowed include "Press Key" but that only allows predefined keys like ENTER, TAB, BACKSPACE, etc. It does not allow a normal letter key (e.g. "s"). The action "Type" does not appear in the list when a <ul> is the target object type.

So how can I send a simple one-letter keystroke to this control? It seems wrong that Truclient assumes what user interactions are possible based on the DOM element type - modern web applications use all kinds of DOM structures to render complex UIs (and allows various user interactions with them).

Is it possible to send a simple one-letter keystroke to a element in Truclient?

user3191192
  • 169
  • 13

2 Answers2

0

Yes. You could drag and drop a click step manually from the toolbar. After that set the target object by directly click the unordered list element.

Erxin
  • 1,786
  • 4
  • 19
  • 33
0

There is no direct type to object step in the toolbar. But there are several workaround you could try.

  1. Use the eval JS on object step and then simulate the keystroke with JS code. The target test object is passed by TruClient with the variable name 'object'.
  2. Create a new action and convert the action to coded from the toolbar. In coded TruClient there is a TCS.object.[tc/userManaged]..type API. The relative document could be found from https://admhelp.microfocus.com/tc/en/12.60-12.62/Content/TruClient/reference/Coded-APIs.htm#type. The object could be created by TCS.object.create, TCS.object.Descriptor methods. One hack way maybe worth to try is record a object relative step and disable it. Then convert the action to coded. The recorded object can be directly referenced from the coded context.

Hope this helps.

Erxin
  • 1,786
  • 4
  • 19
  • 33