Coded UI Test Dynamic Controls
I have recorded a couple of coded ui tests to step through various data collection steps in our asp.net web application. However, we have custom code that renders html on the fly as a user steps through the "wizard" (just using wizard as generalized term). So from a browser perspective, the user will always be on the same page, for example, Wizard.aspx, but when the page is posted back, different html is rendered, with different controls
As a result, when the coded test is running, it sometimes fails because after the post back, the html that is to be rendered hasn't been rendered quickly enough and the search cannot find the control, this happens on clicks as well, i.e the playback is trying to click a control, i.e. a button which may not have rendered yet, I've corrected this via manually adding ThinkTime between steps, but it feels like a hack. As a coded ui test is procceeding, is ther开发者_运维问答e a way to tell Playback to wait until the controls are rendered, I have seen the WaitForControlExist method, but I can't quite figure out where to use it.
I actually found out a way to drive this from the config file without adding manual delays after each step, in case this helps anyone. It sets a 3 second (3000 ms) waittime between each action.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="DelayBetweenActions" value="3000" />
<add key="WaitForReadyTimeout" value="60000"/>
</appSettings>
</configuration>
精彩评论