# Robotframework dictionary problem for help

**URL:** <https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345>\
**Category:** Robot Framework\
**Created:** [11 June 2020 02:17 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345 "2020-06-11T02:17:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![latesir](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/latesir/32/277_2.png) [@latesir](https://forum.robotframework.org/u/latesir)\
**Post date:** [11 June 2020 02:17 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/1 "2020-06-11T02:17:37Z")

</div>

- I created 2 dic through rf and python.
- And i want to get dic’value by ${dic.key}
- the dic created with rf is ok
- the dic created with python is error  
 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/1X/ba3be75ca81118c1d5a240b3df46e35ad43d2dc7.jpeg)

#### I have been puzzled with this puzzling problem for a long time…

### Please help me，thanks

---

<div class="post-metadata">

**Author:** ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)\
**Post date:** [11 June 2020 05:36 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/2 "2020-06-11T05:36:50Z")

</div>

Hi,

Python `dict()` can only be accessed like `${dict}[key]`

RobotFramework dicts are of the type `DotDict()` and can also be accessed with dots.

You can convert a python dict() with the BuiltIn Keyword `Create Dictionary`

[http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Create%20Dictionary](http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Create%20Dictionary)

```python
${dotdict} Create Dictionary ${pydict}

```

---

<div class="post-metadata">

**Author:** ![latesir](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/latesir/32/277_2.png) [@latesir](https://forum.robotframework.org/u/latesir)\
**Post date:** [11 June 2020 05:53 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/3 "2020-06-11T05:53:03Z")

</div>

Oh, thank you , my dai lo 😘

---

<div class="post-metadata">

**Author:** ![latesir](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/latesir/32/277_2.png) [@latesir](https://forum.robotframework.org/u/latesir)\
**Post date:** [11 June 2020 09:04 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/4 "2020-06-11T09:04:26Z")

</div>

Hello, dai lo  
Is there some extension tools for RF to format code.  
My IDE is pycharm.

---

<div class="post-metadata">

**Author:** ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)\
**Post date:** [11 June 2020 09:19 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/5 "2020-06-11T09:19:09Z")

</div>

> [@PyCharm with LSP](https://forum.robotframework.org/t/pycharm-with-lsp/161):
>
> Short version: Install Robot Framework 3.2.1: pip install -U robotframework Install Robot Framework LSP server: pip install -U robotframework-lsp Install LSP Support Plugin to PyCharm: [https://plugins.jetbrains.com/plugin/10209-lsp-support](https://plugins.jetbrains.com/plugin/10209-lsp-support) Add Server Definitions to Language Server Protocol (Executable, robot, ) Download [robot.tmlanguage](https://forum.robotframework.org/uploads/short-url/v8X5OJjwD1aJo2VlH7ZckXwnLPu.tmLanguage) Add path to tmLanguage file to Editor \> TextMate Bundles in Pycharm Preferences. Originally posted by @René in [Slack](https://robotframework.slack.com/archives/C07PJBN64/p1585941000432300)

This Language Server can do it.  
It uses `tidy` wich is a Robot Framework built in tool.

When LSP is running, you can do `Code -> Reformat File`

---

<div class="post-metadata">

**Author:** ![latesir](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/latesir/32/277_2.png) [@latesir](https://forum.robotframework.org/u/latesir)\
**Post date:** [11 June 2020 14:11 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/7 "2020-06-11T14:11:24Z")

</div>

Thanks for your sharing very much.  
But i am sorry, i can’t fully understand how to configure at step 4.  
Is my screenshot right?

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/1X/f21f7196a62be29515bb2897ba354d4547b87a44.png)

---

<div class="post-metadata">

**Author:** ![René](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ren%C3%A9/32/7_2.png) [@René](https://forum.robotframework.org/u/Ren%C3%A9)\
**Post date:** [11 June 2020 14:36 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/8 "2020-06-11T14:36:24Z")

</div>

Please read the full thread there is written what to do on step 4.

You have to enter the path to the robotframework-ls executable

---

<div class="post-metadata">

**Author:** ![logida](https://avatars.discourse-cdn.com/v4/letter/l/c0e974/32.png) [@logida](https://forum.robotframework.org/u/logida)\
**Post date:** [25 July 2020 13:27 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/9 "2020-07-25T13:27:38Z")

</div>

Hi, I am trying to extract keywords from resources into my test case, but it is showing import file not found. hw can i solve this issue.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/1X/cdad5a3be91288ed7eee3caeaa4c7a23fd276022.png)  
My Resource folder file contains all the necessary keywords. As below.  
\*\*\* Settings \*\*\*

Library SeleniumLibrary  
Variables …/PageObjects/Toolspageobjects.py

\*\*\* Keywords \*\*\*

Open Tools Login Page  
[Arguments] {ToolsURL} {Browser}  
open browser {ToolsURL} {Browser}  
maximize browser window

And my python file contains the necessary variables, that are stored to get the relative path of the browser.

# Tools login Page Elements

company\_name = “name:txtCompanyName”  
user\_name = “name:txtUserName”  
password = “name:txtPassword”  
sign\_in = “name:ibtnLoginBottom”

I dont know what to do, tried multiple things, nothing gave most concrete solution.

---

<div class="post-metadata">

**Author:** ![Noordsestern](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/noordsestern/32/4270_2.png) [@Noordsestern](https://forum.robotframework.org/u/Noordsestern)\
**Post date:** [25 July 2020 14:35 UTC](https://forum.robotframework.org/t/robotframework-dictionary-problem-for-help/345/10 "2020-07-25T14:35:40Z")

</div>

Hi @logida,

Please open a new thread for your question next time.

As for your question: in caae you don’t do any tricks with your pythonpath, I think the path to the resource file is wrong. It should be `../../Resource/ToolsKeyword.robot`

Regards
