Forum Discussion

vsumathi's avatar
vsumathi
Occasional Contributor
5 years ago
Solved

Run a shared Keyword test in different projects with different parameters

I have the functionality to import an excel sheet (File A) in one of my project (Project A).  I am using this same functionality in a different project (project B) using a 'shared keyword test'.  When running project B I want to use a different Excel File (File B) in that shared Keyword test. 

I created two parameters 'Excel A' and 'Excel B'. But the problem is, every time I change the parameter in one of my projects the other one is also getting updated with the file. 

I should be able to run the entire project suite using Parameter Excel A in one project and parameter Excel B in the other project.

Let me know your thoughts.

6 Replies

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 2 rankChampion Level 2

    Hi,

     

    I can think about two options:

    -- Either assign a proper value to the parameter of your keyword test before calling it; or

    -- Combine test projects via different test suites and use Project Suite Variables to keep required values for the parameter.

     

  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3

    It sounds like you are saving these parameters somewhere?  If you're going to do that, they need unique names  Try something like this (with your syntax of course).

     

    variable ProjectAExcel = ExcelA

    variable ProjectBExcel = ExcelB

     

     

    Project A

    call MyKeywordTest(ProjectAExcel)

     

    ProjectB

    call MyKeywordTest(ProjectBExcel)

     

    • vsumathi's avatar
      vsumathi
      Occasional Contributor

      Since I am sharing the Keyword test, If I create a parameter for the Keyword test in Project A it's getting shared with Project B also. I want to use different parameters for the shared keyword test in different projects when I run the entire project suite.

      • Marsha_R's avatar
        Marsha_R
        Icon for Champion Level 3 rankChampion Level 3

        Different parameters or different values for the same parameters?