Robot Framework not supporting .py files

Am trying to automate a huge web based process with the help of Robot Framework, Most commonly am using SeleniumLibrary for it, for all my process am getting data from some other resources like excel, json and so on, but for all those am using py files in my directory as a bridge and with the help of my user defined functions am achieving the data driven.

recently i have updated my IDE and Py version as well, after that i got a big shock that all keywords am driving from the Py files turned to red and if i run the robot its throwing error saying that “.Invalid resource file extension ‘.py’. Supported extensions are ‘.resource’, ‘.robot’, ‘.txt’, ‘.tsv’, ‘.rst’ and ‘.rest’.” Because of this am unable to fetch the data or perform any other functions which i have mentioned in py files.

all my base is based on my py files only and now if this .py issue persists then am gone. i have enclosed screenshots and with the sample code which am using to get data from one py file as below. this portal is not allowing me to enclose more than one image, so i have took robot code from pycharm and py code from notepad, please take a look on it and help me to resolve this. please let me know if you need additional details. please let me know if i want to put this in forum as well.

1 Like

Welcome to the forum @geeks143 :slight_smile:

So you have been previously importing these *.py files like this
Resource RegressionReader.py and they no longer work ?

You can import these as library Library RegressionReader.py and then they should work. I am not a PyCharm user so can’t say more how to configure that.

Another way of using Python files in Robot Framework (instead of Library) is using them as variable files https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#variable-files.

1 Like

I moved this post to more suitable category.

1 Like

Thank you so much Mika, yes you are right i have made that small but blunder mistake later on only i have found that. Thank you for your valuable time and mindful suggestion.

1 Like