编码的UI测试 - 如何访问runsettings参数? [英] Coded UI Tests - How to access runsettings parameters?

查看:49
本文介绍了编码的UI测试 - 如何访问runsettings参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临一个空指针异常。 

I am facing an null pointer exception. 

推荐答案

你好iSantha,

Hi iSantha,

当我们使用时TestContext.Properties [" parameter"]用于读取runsettings文件中的参数,您会发现在TestRunParameter部分中定义的参数无法找到。

When we use TestContext.Properties["parameter"] to read the parameters in runsettings file, you will find that parameter defined in the TestRunParameter section can't be found.

您可以调试Coded UI测试代码以检查TestContext.Properties的内容。有AgentId,AngentName和其他属性。

You could debug your Coded UI Test code to check the content of the TestContext.Properties. There has AgentId, AngentName and other properties.

因此,如果你想在你的Coded UI测试中使用一些特定的参数,我建议你使用一些数据文件并使用

用于编码UI测试的数据驱动测试

So if you want to use some specific parameters in your Coded UI Test, I suggest you use some data files and use Data-Driven Test for your Coded UI Test.

类似的情况,请参考以下主题。

Similar situation, please refer to following thread.

https://stackoverflow.com/questions/32597776/testcontext-testrunparameters-in-coded-ui-test



最好的问候,

Weiwei


这篇关于编码的UI测试 - 如何访问runsettings参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆