gpt4 book ai didi

ruby - Windows 资源管理器外壳扩展的自动化 GUI 测试

转载 作者:可可西里 更新时间:2023-11-01 09:26:07 26 4
gpt4 key购买 nike

我正在研究 Windows 资源管理器扩展的自动化 GUI 测试。想想类似 TortoiseSVN 菜单的东西。我希望能够执行 TortoiseSVN 之类的操作 -> 在上下文菜单中显示日志。

如果可能,我更喜欢 Ruby 解决方案,但我愿意与语言无关。

我找到了 this在网络上,它很接近但并不完全符合我的要求。它似乎只有一些非级联菜单默认选项,并且不支持 shell 扩展。

如有任何建议,我们将不胜感激。

最佳答案

看看AutoItX3 .我认为您可能能够让它做您想做的事。

您可以通过 OLE 将其与 Ruby 接口(interface):
http://actsasbuffoon.wordpress.com/2008/12/30/introduction-to-autoitx3/

编辑

我将在这里添加我如何进入资源管理器上下文菜单,也许有人可以弄清楚如何进一步。我只是玩了一下,想看看它有多难:

require 'win32ole'

shell = WIN32OLE.new('Shell.Application')
folder = shell.NameSpace("D:\\")
files = folder.Items
file = nil

# Search for one specific file "test.rb"
files.each { |f| file = f if f.Name == "test.rb" }

# List all items in the context menu of test.rb
file.Verbs.each { |v| puts v.Name }

# At this point I ran out of ideas and couldn't figure out
# how to traverse into the submenus of the context menu...

关于ruby - Windows 资源管理器外壳扩展的自动化 GUI 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7041212/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com