Certification level 1: Html To Pdf results in TypeError (Win10)

Hi,

In Certification 1 (VS Code), when trying to use the keyword Html To Pdf with the tutorial code on my own machine (Win10), I get the following error right after the log INFO Writing output to file (path):

TypeError: cannot pickle 'dict_keys' object

The same robot worked on the Control room, so there is probably an issue with the library on Win10.

Also, the Html To Pdf keyword worked in the interactive console with just <p>Hello world</p>, and the pdf was created.

Is there some workaround or a way to fix the error?

I had this same error as of 03/30/2023 - is there a fix yet?

Hello, could you also attach the robot log file?

Hi, I couldn’t attach the file directly, but here is a screenshot to start with:

I tested the same with this piece of code:

Store the receipt as a PDF file
    [Arguments]    ${order_nr}
    ${pdf_path} =    Set Variable    ${receipts_dir}${order_nr}.pdf
    Wait Until Element Is Visible    id:receipt
    ${receipt_html} =    Get Element Attribute    id:receipt    outerHTML
    Html To Pdf    ${receipt_html}    ${pdf_path}
    [Return]    ${pdf_path}

and it was running just fine for me on Mac M1, Windows 11 (ARM through Parallels) and Windows Server 2019.

conda.yaml

channels:
  # Define conda channels here.
  - conda-forge

dependencies:
  # Define conda packages here.
  # If available, always prefer the conda version of a package, installation will be faster and more efficient.
  # https://anaconda.org/search
  - python=3.9.13

  - pip=22.1.2
  - pip:
      # Define pip packages here.
      # https://pypi.org/
      - rpaframework==22.4.0 # https://rpaframework.org/releasenotes.html

Can you please ensure you update to the latest rpaframework==22.4.0, try again and if the problem persists, then attach here the robot files and a full traceback from the logs so we can investigate?

Thank you!

@s.eskelinen Can you please update your robot.yaml with a task like this:

Run all tasks:
    shell: python -m robot --outputdir output -L TRACE --logtitle "Task log" tasks.robot

and then run it so we’d see the error trace as well in the HTML log? (see example)

Version from template was rpaframework==22.0.0, is now rpaframework==22.4.0. Same error comes up.
Robot and log file attached as zip:
level1.zip (290.8 KB)

Thank you!

This should be fixed with rpaframework==22.5.1 as replied here as well.

1 Like