pythonui-automationsikulisikuli-script

Check application running in sikuli


I'm working in sikuli-1.1.1,python. I need to automate a code to open a website. So, I have to open chrome and type the link in a tab with sikuli. As for now I'm using this code to open chrome,

 app = App("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
 app.open()

but I don't want to open a new instance(window) every time.How to check whether the application is already running or not?.


Solution

  • To answer your question directly - yes, you can do it like this (I only have Sikuli running in Java but that method should be available via the API):

    print app.isRunning()
    

    that should give you true or false response.

    Having said that, you should consider adding some setup/cleanup functionality that will prepare a fresh environment before each test and clean it up after a test is finished. This will reduce the number of false positives and is the right thing to do.