In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Today, I wrote an automatic script for program installation. When debugging, I found that the values of some controls were not automatically refreshed. In view of this problem, after careful analysis and consultation, we found that TestComplete will not automatically refresh the changed values in the control, which requires us to control the refresh ourselves.
1. Define a delay function (parameter: number of seconds delay, condition of execution delay)
Function TimeDelay (DelaySeconds,condition)
Dim interval,startTime
StartTime=Time
Do While CBool (condition)
Sleep (DelaySeconds*1000)
Interval=Second (Time-startTime)
If interval = 40 Then
Log.Error ("Time Out.")
Exit Do
End If
Loop
End Function
2. Namemapping a control that displays the progress (the value:0%-100% of the control):
Set InstallProgress = Aliases.SQLNav.frmSQLNavWizard.panelMain.panelFrameHolder.SelectProduct.pnlNewProducts.pnlRightInstallProgress.labelInstallProgress
3. Call the function in the script:
Call TimeDelay (2) InstallProgress.Caption "100%")
Discovery will be delayed until the specified interval Time Out is exceeded. As analyzed above, the value of the control InstallProgress.Caption is not dynamically refreshed, and the value at the time of the call is obtained, which has not been changed since then.
4. Modify the script:
For controls with dynamic values, it is obviously not appropriate to use the above delay function. For delay processing under controls with dynamic values, you can write a separate script to deal with it, and use the method RefreshMappingInfo () that comes with TestComplete to refresh the control only:
Dim beginTime
BeginTime = time
Do While InstallProgress.Caption "100%"
Sleep (2000)
InstallProgress.RefreshMappingInfo
If Second (time-beginTime) = 40 Then
Log.Error ("Time Out.")
Exit Do
End If
Loop
Or add sys.refresh () to the function to refresh the entire program, but this is not recommended, the whole refresh is very performance-consuming.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.