How to replace value generated in robot framework into python data file?

How can I replace the new value from “next_mobile_number” with the old value of “LOGIN_MOBILE_NUMBER” in python file?


*** Test Cases ***
Update Mobile Number In File
${last_mobile_number} = Get Variable Value ${ONBOARDING_MOBILE_NUMBER}
${next_mobile_number} = Evaluate ${last_mobile_number} + 1
Set Global Variable ${ONBOARDING_MOBILE_NUMBER} ${next_mobile_number}

============= file


Updating an actual Python file at runtime is Very Bad Idea.

Store the actual number in separate file and update that when needed.

1 Like