modify autotest.py for use mac app.
Merge pull request #5834 from shujunqiao/autotest

modify autotest.py for use mac app.