Forum Discussion

Rajesh2's avatar
Rajesh2
Contributor
8 years ago

Can anyone please help me with keyword driven framework using Python in TC

Hello Everyone,

 

I am working in a Desktop application project using Python!!

 

1. Could anyone please help me with keyword driven framework using Python in TC?

2. I need to build a framework using keywords present in excel sheet. Should i use switch case or if else? 

3. I need to use keyword driven framework for navigating from panels/windows. So how to go about it? Please explain me with an example like Navigating from Gmail-Login to Inbox or Inbox to Sent items.

 

Please explain with example!!

 

Thanks and Regards,

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    What you are asking is a lot more than just a few posts on a web forum.  Building a framework that uses keywords and data passed in from an Excel spreadsheet and making it robust enough to be able to navigate a complex application takes work.

     

    Couple of tips for you from my experience, though:

     

    1) Try to find a balance between granularity and broad test methods.  For example, you could go the extreme of having keywords like "CLICKBUTTON" or "ENTERTEXT" or "SELECTDROPDOWN" where you would just build a keyword test on general controls.  But that would take a lot of effort in making sure that you do control detection, etc.  But going to broad as  "RUNTESTCASE2" is too broad and doesn't allow for flexibility.  You should find some place in between that works for your particular skill set and the skills of the rest of your team

    2) DDT is your friend.  Since you want to use Excel, read the articles on DDT.ExcelDriver that are in the help documentation.

    3) Switch statements are going to be your better bet... but the more keywords you have, the bigger the switch statement.  It could get VERY large.  That's why I ended up using something more like data reflection.

     

  • shankar_r's avatar
    shankar_r
    Community Hero

    If you start building some basic level of framework such as,

     

    1. Setup test data sheet path and configure variables.

    2. Do a Loop using DDT in-order to use each row data to validate your AUT.

    3. Create bunch of Common of functions which will help you to do the UI actions.

     

    Once you start doing some basic level of work then you automatically find a way to enhance your Framework.

     

    I'm having good idea on Data-Driven framework but this is all i got Keyword Driven.