Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated documentation #15

Open
SebastianOlthuis opened this issue Mar 19, 2024 · 0 comments
Open

Outdated documentation #15

SebastianOlthuis opened this issue Mar 19, 2024 · 0 comments

Comments

@SebastianOlthuis
Copy link

SebastianOlthuis commented Mar 19, 2024

Please update the documentation if changing implemented API features, your documentation in your wiki and GitHub says this :

#Here are two examples, on how to run a script file multiple times using a simple loop:

# case 1: run an script 10 times
for i in range(10):
    robot.play_script(script_path="test.txt")
    robot.log("Script is completed")

Apparently, it changed to (got this by looking into the dorna file from the API) :

    def play_script(self, file="", timeout=-1):
        try:
            with open(file, 'r') as f:
                lines = f.readlines()
                for l in lines:
                    try:
                        self.play(timeout=0, msg=l)
                    except Exception as ex:
                        self.log(ex)
        except Exception as ex:
            self.log(ex)

        return self.sleep(0, timeout=timeout)

So now it only works if you do this:

result = robot.play_script(file="/path")

If using the old way users get this error if they for some reason update there api :

Traceback (most recent call last):
  File "/Pythonscript", line X, in <module>
    result = robot.play_script(script_path="/Path")
TypeError: play_script() got an unexpected keyword argument 'script_path'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant