Forum Discussion
Hello!
Hmmm Do You have something inside "General events"? maybe something is sitting inside "OnTeststart" event.
- nikki855 years agoContributor
Hi Wamboo,
Thanks for your reply, I didn't create any general events,it seems to load the elements before running a test , this takes much time , after load the elements, it can run correctly, it only happened at one computer , other computers are ok with the same test
Best Regards,
Nikki
- nikki855 years agoContributor
Hello Wamboo,
add some information , I defined the elements like below with VB scripts
set dlg=Aliases.Mwt.dlg
set dlgbtnOK=dlg.btnOK
set dlgbtnYes=dlg.btnYes
set dlgbtnNo=dlg.btnNo
set dlgbtnSave=dlg.btnSave
set dlgMessage=dlg.Message
set dlgMessage1=dlg.Message1
set dlgbtnOpen=Aliases.Mwt.dlg.btnOpen
set dlgbtnOK=Aliases.Mwt.dlg.btnOK
Set btnOverwrite=Aliases.Mwt.dlg.btnOverwrite
Set dlgbtnClose=Aliases.Mwt.dlg.btnClose
Set dlgbtncheck=Aliases.Mwt.dlg.check
Set dlgbtnCancel=Aliases.Mwt.dlg.btnCancel
Set dlgbtnUnzip=Aliases.Mwt.dlg.btnUnzip
Set radioST=Aliases.Mwt.dlg.radioST
Set radioTRUE=Aliases.Mwt.dlg.radioTRUE
Set ComboBox=Aliases.Mwt.dlg.ComboBox 'MP pop up dlg
Set ComboBox2=Aliases.Mwt.dlg.ComboBox2
Set ListTemp=Aliases.Mwt.dlg.ListTemp
'set dlgEdit=Aliases.Mwt.dlg.ComboBoxEx32.ComboBox.Edit
set dlgEdit1=Aliases.Mwt.dlg.Edit 'MP pop up dlg
set Failed=dlg.Message.Failed
set The_password_has_been_changed_successfully_=dlg.Message.The_password_has_been_changed_successfully_
set Save_succeed_=dlg.Message.Save_succeed_
Set Download_Changes_not_possible_=dlg.Message.Download_Changes_not_possible_
Set Are_you_sure_you_want_to_download_=dlg.Message.Are_you_sure_you_want_to_download_
set dlgMessage1=dlg.Message1- tristaanogre5 years agoEsteemed Contributor
Right there is your problem, setting all those variables. If they aren't in a procedure or function but "global" in a script unit, then as soon as your project starts, those variables are attempted to be set. And then, as AlexKaras points out, TestComplete attempts to find those objects and assign the values. Since the application objects that those variables reference aren't present in memory at that point, then TestComplete will take up to the maximum timeout to find the objects before going to the next one.
I would wrap those "set" commands into a Sub or Function and put them in a routine that you can call as needed rather than make them global.- nikki855 years agoContributor
thanks tristannogre, it is strange that the scripts doesn't have the problem at other computers, at other computers ,it just spend less than one second,but at the current computer, the same scripts ,it needs take 8 mins to load all the objects,then to run the scripts.
Thanks,
Nikki
- AlexKaras5 years agoChampion Level 3
Hi,
JFYI, consider this: https://community.smartbear.com/t5/TestComplete-Functional-Web/store-all-name-mapping-objects-in-a-page-and-then-use-in-scripts/m-p/197596/highlight/true#M36102