0
${req_attribute}=  Evaluate  ${result_attribute}.${tgt_record.TGT_ATTR_ID}
2
  • 1
    Please go over Evaluate and edit your question to be clearer. Commented Jul 17, 2022 at 11:20
  • 1
    Please take the time to create a complete minimal reproducible example. What you're doing should work if the variables result in valid python. Commented Jul 17, 2022 at 22:09

1 Answer 1

1

As indicated in comment you can use Evaluate function to evaluate an expression. Expression must use Python syntax. Below is an example:

Evaluate an expression
    [Tags]    TestRail-C000000

    ${first_var} =    Evaluate  2
    ${second_var} =   Evaluate  3

    ${multiplication} =    Evaluate    ${first_var} * ${second_var}
    ${power} =    Evaluate    ${first_var} ** ${second_var}
    ${tuple} =    Evaluate    ${first_var}, ${second_var}

    Log To Console    ${multiplication}
    Log To Console    ${power}
    Log To Console    ${tuple}
Sign up to request clarification or add additional context in comments.

4 Comments

Can I Evaluate like this? ${req_attribute}= Evaluate ${result_attribute},${tgt_record.TGT_ATTR_ID} note- I changed comma instead of dot.
Yes, the result will be a tuple. I'm updating the example to include this case.
Oh then how can I change that tuple into string?
You can use a formatted string: ${string} = Evaluate f"{${first_var}},{${second_var}}"

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.