Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datadriver not picking up test case name from CSV #62

Closed
hbirkdale opened this issue Oct 15, 2021 · 8 comments
Closed

Datadriver not picking up test case name from CSV #62

hbirkdale opened this issue Oct 15, 2021 · 8 comments

Comments

@hbirkdale
Copy link

hbirkdale commented Oct 15, 2021

I thought I saw in tutorials that DataDriver would pick up test case names from the CSV file, but that doesn't seem to be happening for me. The tests are definitely running, and the [Documentation] data is being picked up. Here is my setup:
DATA

*** Test Cases ***,${username},${password},${email},${url_complete},[Tags],[Documentation]
Register New User,hgb55,xxxyyy,hb+tester@somecompany.com,${success_url},,Manually confirm this user does not exist already
Try and register existing user,hgb55,xxxzzz,hb+tester@somecompany.com,${registration_url},,
Try a password that is too simple,hb999,what,hb+tester@somecompany.com,${registration_url},,
Try another password that is too simple,hb999,whatever,hb+tester@somecompany.com,${registration_url},,

TASKS.ROBOT

*** Settings ***
Documentation     Main test suite for registering deals users.
Library           RPA.Browser.Selenium
Library           OperatingSystem
Library           DataDriver    Deals.csv    dialect=userdefined    delimiter=,    encoding='utf-8'
Resource          ../.env.robot
Test Template     Register as a deals user
Suite Teardown    Close all browsers

*** Variables ***
${registration_url}    ${HOST}/deals/registerusers/    # Don't change variable name - in CSV file too.
${success_url}    ${HOST}/accounts/register/complete/    # Don't change variable name - in CSV file too.

*** Test Cases ***
Register with user '${username}' and password '${password}'
    Default    UserData

followed by the "Register as a deals user" keyword - which does execute.

Am I missing something?

@Snooz82
Copy link
Owner

Snooz82 commented Oct 15, 2021

Hi @hbirkdale,

can you put you console output here?
What are the names you get?

@hbirkdale
Copy link
Author

hbirkdale commented Oct 15, 2021

Sorry @Snooz82 - just realized i had posted some pws....here is the update

image

As you can see, the test cases are being named from my one and only test case in robot.task - "Register with user {something}, password {somethingelse} and outcome {someurl}"

This is what was in robot.task
*** Test Cases *** Register with user '${username}', password '${password}' and outcome '${url_complete}' Default UserData

@hbirkdale
Copy link
Author

FYI - when I debug the robot, I took a look at &Datadriver_DATA_DICT, and here is what it shows.
{"Register with user ...": {'arguments': {...}, 'documentation': '', 'tags': [...], 'test_case_name': "Register with user ..."}, "Register with user ...": {'arguments': {...}, 'documentation': '', 'tags': [...], 'test_case_name': "Register with user ..."}, "Register with user ...": {'arguments': {...}, 'documentation': 'Manually confirm thi...st already', 'tags': [...], 'test_case_name': "Register with user ..."}, "Register with user ...": {'arguments': {...}, 'documentation': '', 'tags': [...], 'test_case_name': "Register with user ..."}}

I am not seeing any of the data that I put in the first column.

@Snooz82
Copy link
Owner

Snooz82 commented Oct 16, 2021

That is interesting and not as designed/intended.

i will check that

@hbirkdale
Copy link
Author

That is interesting and not as designed/intended.

i will check that

FYI -- I am using RPA Framework in VS Code for running and debugging.

@Snooz82
Copy link
Owner

Snooz82 commented Oct 20, 2021

@hbirkdale

Can it be, that your CSV file is not really UTF-8, but UTF-8 with BOM (Byte Order Mark)?

Because in that case i can reproduce your behaviour.
You can fix that by selecting the correct encoding.

Library           DataDriver    Deals.csv    dialect=userdefined    delimiter=,    encoding=utf_8_sig

Cheers

@Snooz82 Snooz82 closed this as completed Oct 20, 2021
@hbirkdale
Copy link
Author

hbirkdale commented Oct 20, 2021

Hi @Snooz82 - I guess its possible. All I did was create the file in Excel and Save As with
image
However, there is an option to save with :
image
So let me try that and see if it works.
and I will also try changing the encoding too....:)

@hbirkdale
Copy link
Author

@Snooz82 You were right - that was it. As soon as I changed the encoding it the test case names came from the CSV. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants