DataDriver Error Indication in Settings Section

I am getting Continous error mark after install properly in Robot Framework-DataDriver.But my csv get read by test template.but i want to filter my csv values regarding on my condition ?How should I overcome this issue?

Without proper information about what errors you get when you are doing what, we can not help you, except of telling that it should be all in the docs.

I do not understand what the errors have to do with the filtering, but regarding that, you have to tell by what criteria you want to filter.

1 Like

What does the underline tell?
What error does it show, when you hover?

Can you explain a bit more, what you want to filter? I do not understand the request. Please explain it as best as you can.

Underline tells - Unresolved library: DataDriver.
Error generating libspec:
Importing library ‘DataDriver’ failed: ModuleNotFoundError: No module named ‘DataDriver’
Consider adding the needed paths to the “robot.pythonpath” setting
and calling the “Robot Framework: Clear caches and restart” action. But it rightly takes the Data from csv and My csv is like this
${Department},${ProcessName}
newdept,LeadGeneration
newdept,OrderProcessing
newdept,SoftwareDevelopment
newdept,EmployeeOnboarding
Using Test Template I want to run only two sets such as newdept,LeadGeneration
newdept,OrderProcessing and for that I am also using Library DataDriver file=
/Data/ProcessModule.csv filter=2 in settings sections of test file.But Still I did not get Proper Solution for that?

Ok.
The Error that DataDr Is not found, is probably because your python path is not set correctly in the pycharm plugin.

The Robot Framework Language Server plugin is a bit fragile when it comes to python path settings.

Regarding the filtering:
Where did you get the impression that filter=2 is a supported feature? I am curious.

Here you find how to filter by test name or tags:
https://snooz82.github.io/robotframework-datadriver/#selection-of-test-cases-to-execute

Here you see also the include and exclude argument as an alternative
https://snooz82.github.io/robotframework-datadriver/#Importing

Hope you find this enough information

3 Likes

Thanks for your Patience and solution to get through this doubt.
I get to know about filter=2 feature while I am exploring in ChatGpt regarding this issues.

*** Settings ***
Library           DataDriver    dialect=excel    encoding=utf_8   config_keyword=Config    limit=2

*** Test Cases ***
Example Test Case
    [Template]    Example Keyword
    ${param1}    ${param2}    ${param3}=    Data Driver    test_data.xlsx    Sheet1

*** Keywords ***
Example Keyword
    [Arguments]    ${param1}    ${param2}    ${param3}
    Log    ${param1}
    Log    ${param2}
    Log    ${param3}

:joy::joy:

Lol

Yea ChaptGPT sometime just make up things.
It is quite creative. :wink:

Do not believe what that thing tells.

3 Likes
Hello 
what you want to do makes 2 questions.
1- how to do it
2- why you want to do it

**My answers**

2- in a test campaign, you need to define and build you data sets according the requirements. So if you want to run only 2 lines, the best is to have an excel file with this 2 rows and name the file in consequence (e.g. "run only newdept.xls")

1- i've tried to select only 1 row from an excel file (using datadriven).
you need to add a 3rd variable in the excel file and in your test case, add a condition (run keyword if):


${Department},${ProcessName},${mytag}
newdept,LeadGeneration,yes
newdept,SoftwareDevelopment,no




*** Settings ***
Library            SeleniumLibrary
Library            DataDriver    ../ExcelTest/DataSet.xlsx    sheet_name=Department
Resource           ../MyResources/template01.robot     (where are defined kw1 kw2 kw3 ...)
Suite Setup        kw-suitesetup
Suite Teardown     kw-suiteteardown
Test Template      **kw-mytesttemplate**
*** Test Cases ***
TC01-RunOnlynewdept   ${Department}    ${ProcessName}    ${mytag}          
       
*** Keywords ***
kw-select
    [Arguments]     ${Department}    ${ProcessName}
    kw-1        ${Department}
    kw-2         ${ProcessName}
    kw-3

**kw-mytesttemplate**
    [Arguments]    ${Department}    ${ProcessName}    ${mytag}
    Run Keyword If    "${mytag}"=="yes"    kw-select    ${Department}    ${ProcessName}


hope this can help you.
Isabelle
Experimenting with RFW since 3 weeks... :slightly_smiling_face: