Visual Studio Coded UI:记录并添加断言
我对这个工具非常非常陌生,我才刚刚开始尝试它。
我想测试一个简单的网页。当我创建新测试时,系统会要求我记录它。我启动 IE,单击弹出窗口上的记录按钮并输入地址(例如 google.com)。问题是,一旦我按下记录,“添加断言”按钮就会变灰。
那么,我如何记录浏览 www.google.com 的行为并断言,例如,有一个带有标签“搜索”的按钮?似乎我可以记录或做出断言,但这对我来说没有意义,因为我想自动执行各种操作并检查特定结果。
I'm very, very new to this tool and I'm just starting to experiment with it.
I want to test a simple web page. When I create a new Test, I'm asked to record it. I fire up IE, click the record button on the popup and type in an address (eg google.com). The problem is that the "Add Assertion" button is grayed out as soon as i press record.
So how can I record the act of browsing to www.google.com and asserting that, for example, there is a button with the label "Search"? Seems like I can either record or make assertions and this doesn't make sense to me, as I want to automate performing various actions and checking for specific results.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有办法同时记录和执行断言。通过编码的 UI 测试,我发现最好让我记录的操作相对简短和具体。填写表格并单击下一页对下一页做出断言,记录该页面的新操作。较长的动作录音似乎更容易中断并且更难以更新。
There isn't a way to record and do an assertion at the same time. With coded UI tests I have found it is best to keep my recorded actions relatively short and specific. Fill out a form and click to next page make assertions about the next page, record a new action for that page. Longer action recordings seem to break more often and are harder to update.