用于键盘输入的Visual Studio测试代理设置 [英] Visual Studio Test Agent setup for keyboard input

查看:176
本文介绍了用于键盘输入的Visual Studio测试代理设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试进行编码的UI测试,以便将日期字符串输入到具有jquery验证的文本框中.该字段是日期字段,将接受以下格式的输入

I'm trying to get my Coded UI test to input a date string in to a textbox that has some jquery validation. The field is a date field that will accept input in the following formats

数字(08081988)

numbers (08081988)

数字和斜杠(1988/08/08)

numbers and slashes (08/08/1988)

数字和破折号(08-08-1988)

numbers and dashes (08-08-1988)

数字和十进制(08.08.1988)

numbers and decimal (08.08.1988)

任何其他情况都会导致jquery忽略输入.

Anything else will cause the jquery to ignore the input.

当我通过Visual Studio在桌面上运行测试时,日期字符串将输入到文本框中就可以了.我也可以通过远程桌面将数据输入到我们的自动化机器中.但是,当我使用 测试代理,jQuery失败,文本字段中未放入任何内容.

When I run the test on my desktop through Visual Studio the date string will input in to the textbox just fine. I can enter data over remote desktop to our automation machine just fine as well. However when I run the automated tests using the Test Agent the jquery fails and nothing gets put in the text field.

在与开发人员交谈时,jquery正在寻找"Key Codes".我认为测试代理可能正在将ScanCodes或Ascii发送到文本字段(也许还有其他内容吗?有人知道吗?).这会导致jquery验证失败,因此文本框失败 仍然为空.

In talking with the developer the jquery is look for "Key Codes". I think the Test Agent may be sending ScanCodes or Ascii to the text field (Maybe somethings else? Anybody know?). This causes the jquery to fail validation and therefore the textbox remains empty.

我试图将自动化代码更改为使用< textbox> .text =< string>,Keyboard.SendKeys,My.Computer.Keyboard.SendKeys Windows.Forms.Sendkeys.send和Windows.Forms.Sendkeys.sendwait ,将字符串分解并在以下位置输入每个字符 一段时间后,在使用测试代理"执行自动测试时,未能在文本框中输入数据.我可以看到"SendKeys"正在工作.每当自动类型"指示符闪烁时,光标闪烁.文本框中有一些东西,但文本框中 仍然为空.

I have tried to change my automation code to used <textbox>.text = <string>, Keyboard.SendKeys, My.Computer.Keyboard.SendKeys Windows.Forms.Sendkeys.send andWindows.Forms.Sendkeys.sendwait, break the string up and enter each character one at a time. All have failed to enter data in to the text box while executing the automated test using the Test Agent. I can see where the "SendKeys" is working. The cursor blinks evertime the automation "types" something in the text box but the textbox remains empty.

是否可以更改测试代理发送的代码类型?是在机器的某个地方设置的吗?测试控制器?我的编码是否还有其他问题?

Is there a way to change the type of codes that the Test Agent is sending? Is it set on the machine somewhere? Test Controller? Am I doing something else wrong with my coding?

任何帮助将不胜感激.

推荐答案

我在这里遇到了同样的问题. MSFT的任何人有建议吗? ui的编码方式如何将键盘命令发送到浏览器?

I'm having the same problem here.  Does any one from MSFT have a suggestion?  How is coded ui sending the keyboard commands to the browser?

这肯定会阻止我们继续进行测试.

This is definitely blocking our testing efforts from going forward. 


这篇关于用于键盘输入的Visual Studio测试代理设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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