回放faild找到控件 - 编码的UI测试 [英] The playback faild to find the control - Coded UI test

查看:75
本文介绍了回放faild找到控件 - 编码的UI测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个编码的ui测试,但是我收到了错误:

I created a coded ui test, but i received the error:




我可以在测试开始时看到错误,换句话说,aspnet没有执行第一次..

I can see the error in the beginning of the test, in other words aspnet doesnt perform the first..

以下是测试代码:

publicvoid nuevo()         {             #region Variable Declarations             HtmlComboBox uIPerfilesComboBox =this.UILogOnInternetExploreWindow.UIInicioDocument.UIPerfilesComboBox;             HtmlHyperlink uIEstadisticasPosServiHyperlink =this.UILogOnInternetExploreWindow.UIInicioDocument1.UINavCustom.UIEstadisticasPosServiHyperlink;             #endregion// Select 'Telefonica Móviles (Pruebas y Verificaciones)' in 'Perfiles' combo box             uIPerfilesComboBox.SelectedItem =this.nuevoParams.UIPerfilesComboBoxSelectedItem;             // Click 'Estadisticas Pos Servicios' linkMouse.Click(uIEstadisticasPosServiHyperlink, newPoint(958));         }

第一个操作是更改combo .....(PERFIL),但测试没有执行该操作

The first action is change the combo.....(PERFIL), but the test doesnt execute that action

推荐答案

< p style =""> Hi neonash,

Hi neonash,

请确保可以识别Combobox,你可以添加  ; DrawHighlight()   方法。

Please make sure that the Combobox can be identified, you could add DrawHighlight() method at first.

我在我身边重复,导致这个问题的原因是

I repro it in my side, what cause this issue is

uIPerfilesComboBox.SelectedItem = this.nuevoParams.UIPerfilesComboBoxSelectedItem;


错误信息几乎与您的相同。

The error message is almost the same as yours.

I将其更改为 

I changed it to 

uIPerfilesComboBox.SelectedItem = "the name of the item in my combobox";


uIPerfilesComboBox.SelectedIndex = 0;


然后测试运行良好。 

Then the test run well. 

请尝试一下,让我知道结果。

Please try it and let me know the result.

祝你好运。

祝你好运,

Fletch


这篇关于回放faild找到控件 - 编码的UI测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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