New library or creating new keyword in library

Hi
I would like to create a new library just to me.
What do I need to do?
Just write the .py file?
Can I use simple python here?

I added a new function into an existing library and after instalation of this modified Library the system was unable to recignize the new keyword. Why?

Could you please help?

Thanks

You have two questions. How to create library and how to add new keywords in to existing library.

The first one is explained in the user guide https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#creating-test-libraries

But the second one is more complicated to answer and with the details it’s hard to say anything concrete. What library you are referring to?

Thanks.
To create a new library we can write functions in a python file and then use it importing it in a robot file.

To add a new function, for example, to robotframework-zaplibrary, I create the new function in the py file but when executing robot using the new function the system informs that it can’t find the new function.
Also, in all robotframework libraries there is a group of files and folders organized in the same way. Is this a result of any automation?

For this zaplibrary a very small robot example would help.
Please be aware that I am new to robot.

This is more of a Python environment question than Robot Framework question. When you say you modify existing library, it depends where the modifications happens. Perhaps you did copy the file somewhere where the Python can not find it or something else with the almost infinite possibilities.

Generally speaking, modifying existing library source code isn’t the best option to go. Because it will create other problems for downstream consumers, like CI. Instead it could be better to create new library on top of the robotframework-zaplibrary. This is explained in the user guide https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#extending-existing-test-libraries

1 Like

Thank you.
Another issue, is that I can’t make this library make a scan in zap it always gives an error when getaddrinfo.
Could you please try it?
This is something I have been trying for a week…

I have never used that library and I don’t have any idea how it works. Can not provide support for the library. I think it would be good to post new thread in here, ask in slack or try reaching the developer https://github.com/airesv/robotframework-zaplibrary#who-do-i-talk-to

He doesn’t unswer me. That is the problem… I must contact his firm.

Basically I see few options:

  1. For the library and fix it your self or by someone in your company.
  2. Get the support from the company.
  3. Pay someone (not to me) to do the required fixes.