鉴于自动化元素如何模拟一个单一的左键点击就可以了 [英] Given an Automation Element how do i simulate a single left click on it

查看:229
本文介绍了鉴于自动化元素如何模拟一个单一的左键点击就可以了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AutomationElement child = walker.GetFirstChild(el);

使用Windows自动化我如何模拟器上孩子左单一的点击?

using windows automation How do i simulator a left single click on Child ?

推荐答案

尝试:

AutomationElement child = walker.GetFirstChild(el);
System.Windows.Point p = child.GetClickablePoint();
Mouse.Move((int)p.X, (int)p.Y);
Mouse.Click(MouseButton.Left);

链接:

<一href=\"http://msdn.microsoft.com/en-us/library/system.windows.automation.automationelement.getclickablepoint.aspx\">AutomationElement.GetClickablePoint方法

<一href=\"http://longan.google$c$c.com/svn-history/r87/trunk/Dtf/Dtf/Core/UIItem.cs\">http://longan.google$c$c.com/svn-history/r87/trunk/Dtf/Dtf/Core/UIItem.cs

<一href=\"http://social.msdn.microsoft.com/Forums/en/wpf/thread/0555c1ea-5b0f-4c5e-863c-b54eb510ad40\">Simulate鼠标输入/移动/ WPF的控制离开,没有真正使用鼠标

修改征求意见

看到这个链接:

Mouse.cs

<一href=\"http://kadenautomationtestingplatform.google$c$c.com/svn-history/r11/ATP/ATP/ATP.CoreLibs/Common/NativeMethods.cs\">NativeMethods.cs

介绍TestApi - 第1部分:输入注入的API

这篇关于鉴于自动化元素如何模拟一个单一的左键点击就可以了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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