-1

I just have a head start on Sikuli. I am not sure why I am getting an error. There is a double-click mismatch error.

This is my sample code

    from sikuli import *
    import unittest
    import HTMLTestRunner

    class mytest (unittest.TestCase):

    doubleClick("1.png");
    type("demo")
    doubleClick("2.png");

    suite = unittest.TestLoader().loadTestsFromTestCase(sikuil)
    outfile = open("C:\\Sikuli\\Reports\\report.html", "w") # path to report folder
    runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title=' Report Title', description='desc..' )
    runner.run(suite) 

Error message

[error] script [ sikuil ] stopped with error in line 7 at column 0
[error] SyntaxError ( "mismatched input '' expecting INDENT", )
1
  • You have a class definition without a body... – jonrsharpe May 6 '20 at 7:14
1

Your code example misses indentation after the class line.

I think Sikuli uses Jython, which must use spaces:

4 spaces for indentation, no tabs.

https://wiki.python.org/jython/CodingStandards

So your error is probably caused by the lack of indentation, or mixing tabs and spaces.

Your code should look like this in the IDE, but the empty line also needs spaces as indentation.

class mytest (unittest.TestCase):

    doubleClick("1.png");

Maybe just remove the empty lines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.