Microsoft UI Automation Framework work with Chrome(使用FlaUI抓取chrome网页元素)

参考网址:https://www.e-learn.cn/tag/microsoft-ui-automation

https://www.e-learn.cn/topic/3662339

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6f0a1287-1d75-45ae-93a6-6471932fb546/howto-use-cnet-uiautomation-with-chrome?forum=windowsaccessibilityandautomation

https://social.msdn.microsoft.com/Forums/en-US/2bfe50c1-7382-43e1-9a17-71eeb1c2faec/microsoft-uiautomation-not-able-to-fetch-chromes-context-menu-elements?forum=netfxbcl

 

开发中使用微软UI自动化框架FlaUI,在抓取chrome网页元素时,无法抓取到网页内元素,经查资料发现是chrome启动方式不对,具体原因如下:

Chrome page content can be seen by UIA if you run chrome --force-renderer-accessibility. Only for existing Chrome process it won't work. Though user can create a new tab   chrome://accessibility manually and enable UIA for all or some chosen pages. This method also works for AT-SPI accessibility technology on Linux. Of course, Selenium WebDriver is an industry standard here. But another way exists. Both Mozilla and IE support UIA by default.

设置chrome以“--force-renderer-accessibility”启动,或者在chrome://accessibility页中选中UIA。(ps:国内关于FlaUI的资料是在是太少了)

posted @ 2020-08-25 14:05  六镇2012  阅读(963)  评论(0编辑  收藏  举报