【问题标题】:right click on application in system tray using winapp driver使用winapp驱动程序右键单击系统托盘中的应用程序
【发布时间】:2019-04-11 22:54:40
【问题描述】:

我正在尝试自动右键单击系统托盘中的防病毒图标,但没有成功。有没有不同的实现方式。


我正在尝试的代码如下


require 'selenium-webdriver'


def caps 
    {
        platformName: "WINDOWS", platform: "WINDOWS", deviceName: "mydevice", app: "Root"
    }
end



driver = Selenium::WebDriver.for(:remote, :url => "http://127.0.0.1:4723/", :desired_capabilities => caps )

driver.find_element(:name, 'Notification Chevron').click
sleep(5)
element = driver.find_element(:name, 'Avast')[0]
driver.action.context_click(element).perform()

当我尝试运行此方法时,我看到以下错误

NoMethodError: 未定义方法[]' for nil:NilClass C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/common/action_builder.rb:357:inperform'

【问题讨论】:

    标签: ruby windows selenium-webdriver winappdriver


    【解决方案1】:

    只是一个元素的问题 只要元素被正确识别,driver.action.context_click(element).perform 就是正确的语法

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-16
      • 2012-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-06
      相关资源
      最近更新 更多