9

I'm using LDTP to write a GUI test case script in python. I'm running the script in a virtual machine by nosetests.

And I get a block with the error of unable to find window X, while window X is absolutely displayed on the monitor. This error always occurs after LDTP actions.

Example:

After I open my subscription manager in the virtual machine (rhel6.8), I could find the subscription manager by calling getwindowlist():

>>> getwindowlist()
['frmTopExpandedEdgePanel', 'frmBottomExpandedEdgePanel', 'frmroot@localhost:~',
 'frmx-nautilus-desktop', 'frmSubscriptionManager']

Then I use getobjectlist() to do some action:

>>> getobjectlist('frmSubscriptionManager')
['flr8', 'flr4', 'mnuAbout', 'flr6', 'flr7', 'flr0', 'flr1', 'flr2', 
'flr3', 'ukn2', 'ukn3', 'ukn0', 'ukn1', 'scpn1', 'scpn0', 'scpn3', 'scpn2', 
'lblStatus1', 'lblContract', 'ptl0', 'flr5', 'txtStartEndDateText', 
'tblBundledProductsTable', 'scbr0', 'mnuRedeemSubscription', 
'tchEndDate', 'lblStatus', 'mnuSystem', 'mnuRegister', 'tchStartDate', 
'lblSKU', 'txtSKUText', 'txtProvidingSubscriptionsText', 'tchQuantity', 
'txtSupportTypeText', 'ttblMySubscriptionsView', 'mnuEmpty', 
'txtArchText', 'mnuConfigureProxy', 'txtSupportLevelAndTypeText', 
'mnuHelp', 'mnuOnlineDocumentation', 'lblStart-EndDate', 'mbr0', 
  ......etc]

The window disappeared, even though it was still displayed on my virtual machine's monitor.

>>> getwindowlist()
['frmTopExpandedEdgePanel', 'frmBottomExpandedEdgePanel', 'frmroot@localhost:~', 'frmx-nautilus-desktop']

Why does this error occur, and how should I deal with this situation in an automated test?

1 Answer 1

0

To resolve the issue of LDTP not finding a window even though it's displayed on the monitor in an automated test:

Add wait mechanisms to ensure the window is fully loaded before interacting with it. Ensure the window has focus using setfocus() before performing actions. Use stable and unique identifiers to locate the window. Verify that LDTP is compatible with your virtual machine and application. Implement error handling to capture and handle such errors in your script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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