How to debug an object not ready error

Last edited on

If you get an error like this:

Script Error
  Object First_Name_QLineEdit not ready.

On a line of code that involves a wait function such as waitForObject:

waitForObject(names.First_Name_QLineEdit)

Follow these steps to analyze and solve the problem:

  1. Put a breakpoint on the line that produces the error.

  2. Execute the test case in the Squish IDE: Squish will stop when the breakpoint has been reached and show the Spy perspective.

  3. In the Application Objects view click the Pick toolbar button to turn on “pick” mode. This will hide the Squish IDE.

  4. Return to the AUT and move the mouse over the object in the AUT that the breakpoint refers to (e.g., in this example the Name line edit). Once the object is highlighted (with a red rectangle), click the object. The Squish IDE will now reappear.

  5. In the Squish IDE right-click the object shown in the <code>Application Objects</code> view to pop up the context menu. Click the context menu’s Copy to clipboard (Symbolic Name) menu option. Paste this name into an empty editor/text document so that you can see what it is. Now click the context menu’s Copy to clipboard (Real Name) menu option. Paste this name into the same editor/text document so that both names are present.

  6. In the test script select the complete symbolic name that is used in the wait function in the line with the breakpoint; but do not select the surrounding quotes. (In the example, just select the :First Name_QLineEdit text.). Right-click the selected text and choose the context menu’s Lookup in Object Map menu item. If this fails, open the Object Map view (click the Test Suite view’s Object Map toolbar button) and see if you can find the symbolic name yourself.

  7. Right-click on the symbolic name in the Object Map and choose the context menu’s Copy Symbolic Name to Clipboard menu option; then paste into same editor/text document. Repeat this process, only this time copy and paste the real name.

  8. Compare the two symbolic names that you copied: Is the symbolic name reported by Spy the same as the one from the script? If they are different try changing the script’s symbolic name to match the Spy’s and try the test again. If this doesn’t work use Undo to restore the original symbolic name in the script, and continue.

  9. Do both real names have identical container properties (“window”, “container”)? If not, look up both container objects in the Object Map and compare their symbolic and real names too. Do this recursively to see if there are any discrepancies.

  10. If you find a discrepancy, for example, suppose you find that both have a caption property but whose value is different, then the solution might be to use inexact matching (e.g., using wildcards or regular expressions). You can edit the Object Map to set the value of most (but not all) properties to use inexact matching. See Improving Object Identification and Object Map view .