kalldrexx
15 years agoContributor
Having trouble figuring out to handle a process in a Delphi 6 application
I am having trouble dealing with the commit process of our company's Delphi 6 application with my automation efforts in TC 7. When changes are committed (via button press) there are 3 steps that occur:
1) Validation checks are performed, and any failures are shown to the user and if none are critical the user is allowed to hit the proceed button.
2) A commit confirmation dialog appears, showing what changes are pending and allows the user to proceed or cancel the commit
3) Once the commit is completed, whatever control in the GUI had focus regains focus
There are several issues with this process (in regards to my TC automation efforts).
Step 1 is an optional step, it may or may not occur depending on what validation rules are enabled. This checking can take anywhere between 0 and 60+ seconds depending on the complexity of the enabled validation rules and the complexity of the account. Until the validation checks are completed there is no instance of the validation check UI, and thus the application is just stuck in an unresponsive state until checking is completed. There is no instance of the check result UI also if no validation checks fail. This means that I can't simply just do a wait for the window, because I can't predict when the window will show up nor can I predict IF the window will show up.
Step 2 is also an optional step. If no changes were made in the session but the user still pressed the commit button, then the confirmation window will not appear (no changes to confirm) and it goes straight to step 3. This is also the case in some other scenarios where things do change (this is by design). This means I can't wait for this window to be visible, because it won't always be visible (and you can't predict if it will or not).
The only way I could think to handle this properly is to perform a loop, where I first check if the validation check window exists and visible (if so hit the proceed button), then check if the commit handler window is visible (If so hit the OK button and exit the loop), and finally check if the main application window has regained focus (should be a good indication that it is finished).
The issue is that if the commit handler never shows, I have no way to make the 3rd condition trigger due to the way TestComplete handles focused items. My main window's Focused property is always true (even after commit) because the window isn't what has focus (according to Testcomplete at least), an unpredictable control inside the window has focus. Sys.Desktop.ActiveWindow() returns the control, not the actual application window. I can't go through the parents because I can't predict how far deep the control with focus is.
Lastly, I can't change anything with the application itself. I am a QA Engineer and have no access to the actual development environment, nor do I have access to commit changes to the application (especially one as deeply ingrained as the commit process).
Any suggestions on how to do this would be greatly appreciated.
1) Validation checks are performed, and any failures are shown to the user and if none are critical the user is allowed to hit the proceed button.
2) A commit confirmation dialog appears, showing what changes are pending and allows the user to proceed or cancel the commit
3) Once the commit is completed, whatever control in the GUI had focus regains focus
There are several issues with this process (in regards to my TC automation efforts).
Step 1 is an optional step, it may or may not occur depending on what validation rules are enabled. This checking can take anywhere between 0 and 60+ seconds depending on the complexity of the enabled validation rules and the complexity of the account. Until the validation checks are completed there is no instance of the validation check UI, and thus the application is just stuck in an unresponsive state until checking is completed. There is no instance of the check result UI also if no validation checks fail. This means that I can't simply just do a wait for the window, because I can't predict when the window will show up nor can I predict IF the window will show up.
Step 2 is also an optional step. If no changes were made in the session but the user still pressed the commit button, then the confirmation window will not appear (no changes to confirm) and it goes straight to step 3. This is also the case in some other scenarios where things do change (this is by design). This means I can't wait for this window to be visible, because it won't always be visible (and you can't predict if it will or not).
The only way I could think to handle this properly is to perform a loop, where I first check if the validation check window exists and visible (if so hit the proceed button), then check if the commit handler window is visible (If so hit the OK button and exit the loop), and finally check if the main application window has regained focus (should be a good indication that it is finished).
The issue is that if the commit handler never shows, I have no way to make the 3rd condition trigger due to the way TestComplete handles focused items. My main window's Focused property is always true (even after commit) because the window isn't what has focus (according to Testcomplete at least), an unpredictable control inside the window has focus. Sys.Desktop.ActiveWindow() returns the control, not the actual application window. I can't go through the parents because I can't predict how far deep the control with focus is.
Lastly, I can't change anything with the application itself. I am a QA Engineer and have no access to the actual development environment, nor do I have access to commit changes to the application (especially one as deeply ingrained as the commit process).
Any suggestions on how to do this would be greatly appreciated.