下面是一段Rhino JS脚本代码。
可以为用户提供以下几组输入元素:
选项 1(在 UI 中带有重新发送按钮)->
Index 0 - Enter otp password
Index 1 - Cancel Option
Index 2 - Resend OTP.
Index 3 - Resend OTP to user email
选项 2(UI 中没有重新发送选项)->
Index 0 - Enter otp password
Index 1 - Cancel Option
Index 2 - Resend OTP to user email.
我如何动态映射用户提供的值(将 OTP 重新发送到用户电子邮件),对于最终用户提供的上述两个选项,可以是/否。
我从 UI 获得响应作为数组列表。
对于选项 1,我需要像这样检索值。
var usrProvidedValue = callResponse.get(3).getSelectedIndexes()[0];
对于选项 2,我需要像这样检索值。
var usrProvidedValue = callResponse.get(2).getSelectedIndexes()[0];
我没有跟踪向用户提供了哪个选项。谁能帮忙解决这个问题?