Skip to content

Outdated documentation  #15

@SebastianOlthuis

Description

@SebastianOlthuis

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions