Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..
703 views

TruClient: object.selectedIndex doubt

Jump to solution

Hi all, 

I've read on a response on the forum a solution to select an accurate button from a drop down list that consist in the object.selectedIndex method. 

Can anyone explain me how to use this method in a TruClient script? I've search on-line but I haven't find examples or similar. 

Thanks a lot for support, 

Lorenzo

0 Likes
1 Solution

Accepted Solutions
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: TruClient: object.selectedIndex doubt

Jump to solution

The easiest way, in my opinion, is to use a selection step:

  • Drag a "Generic Object Action" from the Toolbox
  • Select your drop-down object
  • Change the step action to "select" (under Step section > Action)
  • Define your selection criteria: text or ordinal (under Argument section)

If you prefer to use "object.selectedIndex", do the following:

  • Drag an "Evaluate JS on Object" from the Toolbox
  • Select your drop-down object.
  • In the step arguments, enter your code, for example:
    object.selectedIndex=2
    Here, "object" is the object you selected for the step and the JS code you entered will be evaluated on that object.

 

Edo

View solution in original post

3 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: TruClient: object.selectedIndex doubt

Jump to solution

The easiest way, in my opinion, is to use a selection step:

  • Drag a "Generic Object Action" from the Toolbox
  • Select your drop-down object
  • Change the step action to "select" (under Step section > Action)
  • Define your selection criteria: text or ordinal (under Argument section)

If you prefer to use "object.selectedIndex", do the following:

  • Drag an "Evaluate JS on Object" from the Toolbox
  • Select your drop-down object.
  • In the step arguments, enter your code, for example:
    object.selectedIndex=2
    Here, "object" is the object you selected for the step and the JS code you entered will be evaluated on that object.

 

Edo

View solution in original post

Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: TruClient: object.selectedIndex doubt

Jump to solution

Thanks for the response! I will try your suggestion. 

Lorenzo

0 Likes
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: TruClient: object.selectedIndex doubt

Jump to solution

Thanks Edo, your suggestion worked well: I've tried both the possible solution, and the selection of a specify option from a drop-down menu goes fine in the VuGen/Develop execution. Below, an image from the Develop Mode of the first solution, using a "Generic Object Action" function from the Toolbox menu. 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.