1

I need to verify bunch of sites that are using our templates. After login in I need to verify many info which I will put in the second table. How to write the gherkin code so that For each item in table "userinfo" it goes through All the items in table "siteinfo". I am seeing error calling them by userinfo.url or siteMenu.menuiitem. I am using python-bdd.

Scenario Outline: Login to SAP
    Given User is on login page url <url> 
    When User enters username <username> and passwrod <password>
    Then user should see <menuitem> <title> and <description>  



    Example: usefinfo  
    | url    | username| password   |
    | siteA  | Userx   | pass1      |
    | siteB  | UserY   | pass1      |

    Example: siiteInfo
         |menuitem               | title   | description      |
         |Community Managment    |  T1     | Text1            |
         |User Managment         |  T2     | Text2            |
         |Environment Management |  T3     | Text3            |  
         |Loggin                 |  T4     | Text4            |
         |Miscellaneous          |  T5     | Text5            |


   
Rana
  • 389
  • 5
  • 17

1 Answers1

0

Use a different approach. Instead of trying to write one hugely complex low quality Cuke, write several simple high quality cukes.

Once you have a set of cukes that verify correctly that one particular site works correctly with your templates, then run that set of cukes against your other sites. You can do this by externalising site, perhaps as an environment variable, or by modifying cuke config, or by running the same set of cukes in different places.

This will be a much more sustainable solution in the medium term particularly when

  • you get asked to add new tests for each site
  • you get asked to add a site specific test.
diabolist
  • 3,990
  • 1
  • 11
  • 15
  • I want to learn the process, not looking for workaround. – Rana Aug 24 '22 at 17:58
  • Its not a workaround its a different approach; arguably a much better approach. Using data tables in Cucumber in a highly complex way is a poor approach. This is agreed by all members of the cucumber core team and the original author of cucumber. But hey feel free to ignore the advice given by people with vast experience of using Cucumber. – diabolist Aug 31 '22 at 11:16