0

I am new to RF. I want to use user created variable later in the test case. First I assigned value to a variable ${PL_VIN} using keyword "Get Text". Now I want to input this value to a text box.In "Output.xml" file I am able to see that the value is assigned to ${PL_VIN}.But when using it later i am getting error that "Variable not found". Do i need to add this user created variable to Locators file?

Script:

Assigned value as below:

${PL_VIN} = Get Text    ${VIN_Search Result_Title_WO_Acc_Info}

Using it later in the same test case as below:

Input Text  ${VIN_Test Box_Wrk_Dup_Title_WQ}    ${PL_VIN}

Output in output.xml

When Getting text:

msg level="INFO" timestamp="20150624 23:13:22.561">${PL_VIN} = SED1T0751ES624687</msg>

When using it later:

Variable '${PL_VIN}' not found. Did you mean: ${BPO_Link}
0

1 Answer 1

1

I think your line with varaible assignment misses a tabulator and output.xml just prints the line of source code.

Try

${PL_VIN} =    Get Text    ${VIN_Search Result_Title_WO_Acc_Info}
Log To Console    ${PL_VIN}    # just for debugging

if that does not work, the problem is the implementation of Get Text. It is not a built-in keyword but probably from selenium2library. If so, make sure that SED1T0751ES624687 (the value ${VIN_Search Result_Title_WO_Acc_Info} apparently resolves to) is a valid locator and check the whole output of output.xml for other error messages.

Sign up to request clarification or add additional context in comments.

5 Comments

Thank you for your response Würgspaß.. but i have given the spaces properly... If you see the output, the text "SED1T0751ES624687" is getting assigned properly to ${PL_VIN}... but later i am not able to use...
@Devi: the code in your question does in fact have incorrect number of spaces. Make sure your question shows the actual code that is causing the problem.
@Bryan Oakley: In my text file the spaces are correct. But when copy and paste it here in website, it is becoming improper.
@Devi: all we have to go on is what is posted. It's your job to make sure the posted code accurately reflects your problem. A simple test is to copy and paste the code from your question into a new file and try to run it again yourself.
@Devi: I think you should edit your question and post more contents of your log files. Either output.xml or log.html. The line you've posted from output.xml is probably not the actual problem but some follow-up error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.