String operation needs to be done? Help


Badge +3

i have a question please help!

 

i have to give a security question in a field

but the answer of the security question is the Last word of the question itself

 

for e.g what is your name?

name is answer which i should put it into text box

 

Last word of question is the answer

 

 

can anyone tell me how to do it using string opertaions or any other way but security questions are always changing we have to do it in a dynamic way


2 replies

Userlevel 1
Badge +8

Hi, you can implement this using the following commands:

  1. Recorder: Get Property (innerHTML) of the question using DOM XPath and assign the output to str_QuestionValue.
  2. String: Extract Text: On str_QuestionValue, use with Start Text After <space> and End Text Before ? and assign the output to str_AnswerValue.
  3. Recorder: Set Text using DOM XPath with str_AnswerValue.

Using DOM XPath ensures your automation script is flexible enough to dynamically handle different security questions.

Please mark the response as a solution if it helps you.

Badge +3

it doesnt work @DATTA.KOTHAMASU like you said

Reply