cancel
Showing results for 
Search instead for 
Did you mean: 

Replaying a TestRecorded file on another Windows

Uwe_Raabe
Occasional Contributor

Replaying a TestRecorded file on another Windows

Hi,



I have successfully managed to record some user input to my application with TestRecorder on a Windows XP machine. I have imported this file into a TestComplete project for replay. But my TestComplete runs on Windows 7 and the replay gets stuck when a message box is displayed waiting for confirmation. It seems that TestComplete doesn't recognize the Windows 7 window as the one from Windows XP.



Can I do anything about that? (Perhaps some mapping)

Do I have to replay the recorded data on a similar system (Windows version, language) as it has been recorded?



Thanks,

Uwe Raabe
6 REPLIES 6
YMinaev
Staff

RE: Replaying a TestRecorded file on another Windows

Hi,



Can you describe the problem in detail? What exact code fails and what exact behavior do you observe?
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Uwe_Raabe
Occasional Contributor

RE: Replaying a TestRecorded file on another Windows

During the recording on Windows XP there was a situation where a message dialog popped up requesting a Yes/No/Cancel decision,which was answered with a click at the No-button. The caption of the dialog is "Bestätigen", which is "Confirm" in German (mind the umlaut).



The corresponding keyword test created by importing the recorded data expects a window named "wndBest_tigen" (the umlaut is mapped to an underscore).



When I run that keyword test on Windows XP everything works fine, but when I run it on Windows 7 TestComplete waits for the message dialog until it times out. Of course the same exe is used for recording and playback.



I converted the keyword test to a script and the offending line is:



Aliases.twincam.wndBest_tigen.btnNein.ClickButton;   



(TwinCAM is the application name and "Nein" is German for "No")
Uwe_Raabe
Occasional Contributor

RE: Replaying a TestRecorded file on another Windows

I just discovered that the window classes for the message dialog are different on WindowsXP (TMessageForm) and Windows 7 (#32770).



This seems to be a consequence of Delphi 2010 checking for the OS in function MessageDlgPosHelp.



The corresponding script for the Windows 7 version would be:



Aliases.twincam.dlgBest_tigen.DirectUIHWND.CtrlNotifySink.btnNein.ClickButton;



Is there a chance to cover this with some sort of mapping?
YMinaev
Staff

RE: Replaying a TestRecorded file on another Windows

Hi,



It looks like the problematic dialog is created in different ways in different Windows versions. I recommend that you ignore its window class and recognize it by caption or by message text.
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Uwe_Raabe
Occasional Contributor

RE: Replaying a TestRecorded file on another Windows

Can you give me a hint how I can do that?



I just imported the recorded data to a keyword test and later converted it to a script.



Would it be better to work with the flat model?


YMinaev
Staff

RE: Replaying a TestRecorded file on another Windows

Hi,



In your code, where you address the problematic dialog, try replacing its window class (the first parameter of the Window method) with a wildcard. It looks like its caption alone should be unique enough to recognize it.
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors