Reputation: 57
I'm using a combination of Python and Squish for Qt to write tests on a Qt GUI, but I have noticed when I copy and paste tests from a suite I have and move them to another suite or computer with Squish the file will run, but when it runs anytime it sees an object name it does not recognize it and throws an exception. Most of the time I use the picker tool to go get the object name and place it where the old object name was and it works (I might add that the object names haven't changed I'm literally copying and pasting a string over THE SAME EXACT string). I must be doing something wrong. Has anyone seen this or have a way of resolving the issue so I don't have to re-record?
Upvotes: 0
Views: 383
Reputation: 732
@EugenG is right, the object map contains the mapping from symbolic name (:OK_Button
) to real name ({type='Button' text='OK'}
) and thus you need to copy the respective entries to the object map of the new test suite, or simply "teach" them in the fly with Squish's Object Name Found handling while executing the test script. To speed this up, Squish version 6.4+ will support reducing the default timeout for waitForObject() & co via testSettings.waitForObjectTimeout.
And @EugenG is also right about the possibility to share an object map between test suites.
Upvotes: 0
Reputation: 805
... but I have noticed when I copy and paste tests from a suite I have and move them to another suite or computer with Squish the file will run, but when it runs anytime it sees an object name it does not recognize it and throws an exception ...
For your test script, Squish creates this suite folder you mention. Inside this folder, you also have besides the test.py file, a object.map file (in which squish stores all the objects that you use inside the test). Also, besides those 2 files you have a suite.conf file.
Instead of copy/paste your test script file, you could move the suite folder on the other computer, and there open it in SquishIDE. Or along with the test script, copy also the object.map file.
Upvotes: 3