The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> AutomatedQA / SmartBear TestComplete

Pages: 1
B0BBY
Newbie


Reged: 07/01/10
Posts: 3
"window does not respond" with dialog popup
      #635176 - 07/18/10 12:09 PM

I am testing a windows app with testcomplete, and I am trying to enter invalid values into a field. The expected behavior is to receive a dialog box alerting the user the value they have entered is invalid.


So I have the script inputing value, checkpoint on the popup text to verify its what's expected, then move on.


the program is checking the value in the box in realtime, so if the valid range is 0-99, and you try to enter "888", as soon as you press the third 8, the popup occurs telling you invalid. when you click ok, the focus returns to where you were with your "888" highlighted in the text box ready to be changed.


The problem is I am getting a "window does not respond" every time this happens due to the popup taking focus away, i guess, before the: edit["wText"] = "888"; can know that it's finished.

How can I avoid this. This tool allows the user to enter values for 100's of different fields and I need to verify for each field that all within range don't generate a popup and are accepted, and that all out of range generate the popup and do not allow entry.


i'm using TC 7.52


Post Extras: Print Post   Remind Me!   Notify Moderator  
PavelT
Member


Reged: 01/21/10
Posts: 94
Re: "window does not respond" with dialog popup [Re: B0BBY]
      #635411 - 07/20/10 03:34 AM

Hi,

Try using ["Keys"] method instead of assigning value directly to ["wText"] property, and check if the popup window appeared each time after sending keystrokes to the field.


Post Extras: Print Post   Remind Me!   Notify Moderator  
B0BBY
Newbie


Reged: 07/01/10
Posts: 3
Re: "window does not respond" with dialog popup [Re: PavelT]
      #635424 - 07/20/10 06:16 AM

PavelT, Thank you mate! worked like a charm getting rid of the popup delay.

it has created a bit of different problem though.

There are default values in the text boxes, so using "keys" will append to whatever is already in there. editing the wtext would totally replace the current value. is there some clever "highlight selection" or somethign of that nature that I'm unfamilar with that I can stick in front of the keys for each new box selected?



Edited by B0BBY (07/20/10 06:49 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
PavelT
Member


Reged: 01/21/10
Posts: 94
Re: "window does not respond" with dialog popup [Re: B0BBY]
      #635442 - 07/20/10 07:13 AM

When I used Keys method for edit boxes in my tested applications, the values were selected automatically and therefore were replaced after sending new keystrokes (unless I was setting focus to editbox before that)

Anyway, you can use another workarounds:
1) clear edit field first via the same property:
edit["wText"] = ""
and then send new text to it:
edit["Keys"]("888")
2) select the text in editbox before sending new value to it
by doubleclicking it: edit["DblClick"](1,1)
or by sending Shift+End to it: edit["Keys"]("![End]")


Post Extras: Print Post   Remind Me!   Notify Moderator  
Alex - AQA
Active Member


Reged: 10/06/03
Posts: 932
Re: "window does not respond" with dialog popup [Re: PavelT]
      #635577 - 07/21/10 04:02 AM

Hi,

Here is another variant.

The "Window does not respond" message occurs due to the modal window (popup) appearance. To avoid this error, use the code snippet below that sets the 'wText' property of the 'edit' object asynchronously and handles the appearance of the pop-up window. You will need to modify object names according to the actual objects structure of your application - the script just demonstrates the idea.

Code:

Runner["SetObjectPropertyAsync"](edit, "wText", "888");
var dlg = Sys["Process"]("MyTestedApp")["Window"]("MyMainWindow")["WaitWindow"]("ErrorDialogBox", 5000);
if (dlg["Exists"])
dlg["Window"]("Button","OK")["ClickButton"]();
else
Log["Message"]("The window has not appeared");



For more information about asynchronous method calls, refer to the 'Calling Methods Asynchronously' help topic:
http://www.automatedqa.com/support/viewarticle.aspx?aid=4227

--------------------
Regards,
Alex - SmartBear Support


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 8 anonymous users are browsing this forum.

Moderator:  NickAQA, Robert Martin, martinh, brentpaine 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2343

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5