I am trying to automate a right click on a operation on a icon in windows system tray but having difficulties in doing so.
I found one implementation in one of the winappdriver forum but getting error in. below is my following code snippet
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()
and the error I get is
NoMethodError: undefined method []' 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'
Any help on this is appreciated
Thank you