Retrieve an element from a list

Below is a Rhino JS script code.

User can be provided with below sets of input elements:

Option 1 (with resend button in UI)

Index 0 - Enter otp password
Index 1 - Cancel Option
Index 2 - Resend OTP.
Index 3 - Resend OTP to user email 

Option 2 (no resend option in UI) →

Index 0 - Enter otp password
Index 1 - Cancel Option
Index 2 - Resend OTP to user email.
Index 3 - Regenerate OTP

How can I map dynamically the user provided value for (Resend OTP to user email) which can be yes/no for the above two options end user is provided with.

I am getting the response from UI as an arraylist.

For option 1, I will need to retrieve value like this .

var usrProvidedValue = callResponse.get(3).getSelectedIndexes()[0];

For option 2,I will need to retrieve value like this .

var usrProvidedValue = callResponse.get(2).getSelectedIndexes()[0];

I am not keeping track of which option user is provided with. Can anyone help with a solution on this?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.