Variables.rst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Dealing with variables
  2. ======================
  3. You know the basic variable format ``$(ColumnFromDataFile)`` which works in Locators and value fields.
  4. For instance:
  5. * ``//@id[$(SomeColumnName)]`` will replace the locator at run time with the content of the data file of column ``SomeColumnName``
  6. * ``$(URL)`` in the Value 1 or Value 2 will replace the Value at run time with the content of the data file of column ``URL``
  7. You may combine several variables into one expression
  8. * ``http://($(BASEURL)-$(URLPART)`` will work, if your data file has the columns ``BASEURL`` and ``URLPART``.
  9. Most probably you guessed it already - Column names are case sensitive. And columns may not be used twice.
  10. Special variables for APIs
  11. --------------------------
  12. TODO: Write Doku.
  13. Faker
  14. -----
  15. From Version 2020.04.6rc4 (April 2020) you can also use all the methods, that the famous python module ``Faker`` provides.
  16. The syntax is:
  17. ``$(FAKER.<methodName>)``
  18. Examples:
  19. * ``$(FAKER.email)`` will generate random E-Mail addresses
  20. * ``$(FAKER.name)`` will generate a random name
  21. To see all the methods, head over to https://faker.readthedocs.io/en/stable/fakerclass.html. Because you use ``baangt``
  22. you can use all Faker Methods without writing a single line of code.
  23. Info for Developers
  24. ^^^^^^^^^^^^^^^^^^^
  25. Source in ``baangt.base.Faker.py``. Called from ``baangt.TestSteps.TestStepMaster.py`` from ``__getFakerData``.
  26. Currently it is not supported to hand over parameters.