Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 1752 by sfuentes...@gmail.com: Import Variables keyword should
import files even if they are already imported
https://code.google.com/p/robotframework/issues/detail?id=1752
RF:2.8.6
Python: 2.7
OS: W7
Thanks in advance for your help.
I have installed RF 2.8.6 and I am using import variable as is shown below,
somehow seems is not working, the payment_variables.py file is created
with some values in it in the first test, then is updated for the second
tests (I can verify this by open the file directly), but the variable is
not being re-imported / updated.
Steps to reproduce it
1.- Create a variable file as x.py with some variables and values
example
('fields_to_validate', {'session
id': 'YjI2ZTVlYmItYTllZC00N2Q2LWI4NjMtMGZlN2M5NTYxNzAy', 'IP
address': '88.88.88.88', 'Amount': '10.64', 'Last4CCDigits': '1111', 'Product
Code': '7181', 'Transaction Status': 'true', 'CCType': 'VISA', 'Error
Code': '0'})
2.- Import the variable file and check its variables and values
Import Variables ${RES_eCAPS_WECAN}/x.py
3.- Make changes in the values of the variables and save the file
4.- Import the variable file again and check its variables and values
I expect the 'import variables' keyword should import file even if was
already imported, but this seems not be the case, because the variables
keep the values gotten in the first Import (Step 2).
any suggestion?
here you go more details.
in the following example may help to understand what is going on.
I first read the file using OperatingSystem.Get File and its content is
displayed.
right after that I use BuiltIn.Import Variables to import the variables
from the same file, and clearly the content is different.
any idea? shouldn't Import Variable re-import.
KEYWORD: ${the file} = OperatingSystem.Get File
${RES_eCAPS_WECAN}/payment_variables.py
Documentation:
Returns the contents of a specified file.
Start / End / Elapsed: 20150624 12:05:29.847 / 20150624 12:05:29.848 /
00:00:00.001
12:05:29.848 INFO Getting
file 'C:\Workspace\CAPSProject\capstest\resources\eCAPS\eCAPS_WECAN\payment_variables.py'
12:05:29.848 INFO ${the file} = fields_to_validate =
{'CCType':'','Transaction Status':'true','Error Code':'0','IP
address':'88.88.88.88','Amount':'10.64','Last4CCDigits':'','session
id': 'YjI2ZTVlYmItYTllZC00N2Q2LWI4NjMtMGZlN2M5NTY...
KEYWORD: BuiltIn.Import Variables ${RES_eCAPS_WECAN}/payment_variables.py
Documentation:
Imports a variable file with the given path and optional arguments.
Start / End / Elapsed: 20150624 12:05:29.850 / 20150624 12:05:29.853 /
00:00:00.003
12:05:29.853 INFO True
C:\Workspace\CAPSProject\capstest\resources\eCAPS\eCAPS_WECAN\payment_variables.py
[u'overwrite=True']
<module 'payment_variables'
from 'C:\Workspace\CAPSProject\capstest\resources\eCAPS\eCAPS_WECAN\payment_variables.py'>
[('fields_to_validate', {'session
id': 'YjI2ZTVlYmItYTllZC00N2Q2LWI4NjMtMGZlN2M5NTYxNzAy', 'IP
address': '88.88.88.88', 'Amount': '10.64', 'Last4CCDigits': '1111', 'Product
Code': '7181', 'Transaction Status': 'true', 'CCType': 'VISA', 'Error
Code': '0'})]
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.