0

I've been trying to use the faker library to generate data without having it in my test cases as static data.

I have tried calling fake.md5(raw_output=False) directly from my keyword and also by creating a variable and assigning it this value, but neither has the intended effect. It seems that no matter what I do, the only output I'm getting during my test is fake.md5(raw_output=False).

What am I doing wrong?

Edit: My keyword (it writes to a specific field, this is just a test keyword to make sure I can use faker) -

Write username
    ${md5}=    MD 5
    ${my data}=    log    md5: ${md5}
    Input Text    a11y-username    ${my data}

Edit #2 - I realized I had missed out the log keyword, I have updated my code

Bence Kaulics
  • 7,066
  • 7
  • 33
  • 63
LeonH
  • 1,039
  • 2
  • 22
  • 45
  • You seem to have completely changed what you're asking. First it was an issue with how to use faker, now you're asking about the error `object type of 'NoneType' has no len()`? There's no code in your question that is trying to use a `len` function. If you're facing a different problem, please ask in a separate question rather than change this question. – Bryan Oakley Jul 16 '14 at 15:41
  • I have removed the error code, it was the error for mispelled code. – LeonH Jul 16 '14 at 15:45

1 Answers1

1

The problem is in this statement:

${my data}=    md5: ${md5}

Robot expects the first cell (or the first cell after a variable name) to be a keyword. So, in this case it thinks md5: ${md5} is a keyword, which it obviously is not. That is why you get the error No keyword with name 'md5: ${md5}' found.

I don't know what you're expecting to do with that line of code. Your value is already in a variable, are you trying to copy it to another variable, or simply print it out?

If your intention was to log the value, use the Log keyword:

Write username
    ${md5}=    MD 5
    log  md5: ${md5}

If you instead want to copy the value to another variable, you can use the Set Variable keyword:

write username
    ${md5}=  MD 5
    ${my data}=  set variable  ${md5}
    Input Text  a11y-username  ${my data}
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • Please see my edit, I have to use my phone to comment unfortunately. My workplace blocks external JavaScript. – LeonH Jul 16 '14 at 15:02