Reputation: 3534
I have a flutter app that has been configured according to here. I then am instantiating the app with these caps:
caps = {
platformName: :ios,
udid: "C942CC95-20A0-4348-A88C-692811C1F4AF",
automationName: "Flutter",
bundleId: "com.example.myDemoAppFlutter"
}
driver = Appium::Driver.new({ caps: caps, global_driver: true })
But when I try this code:
include Appium::Flutter::Finder
element = by_semantics_label("Increment Button")
Appium::Flutter::Element.new(driver, finder: element)
(element
is a long string)
I get this error:
undefined method `bridge' for #<Appium::Driver:0x000000010890f638 @core=#<Appium::Core::Driver:0x000000010890f4d0 @delegate_target=#<Appium::Core::Driver:0x000000010890f4d0 ...>, @automation_name=:flutter, @custom_url="http://127.0.0.1:4723/wd/hub", @caps=#<Appium::Core::Base::Capabilities:0x000000010890f138 @capabilities={:platformName=>:ios, :udid=>"C942CC95-20A0-4348-A88C-692811C1F4AF", :automationName=>"Flutter", :bundleId=>"com.example.myDemoAppFlutter", :newCommandTimeout=>0}>, @enable_idempotency_header=true, @default_wait=nil, @port=4723, @wait_timeout=30, @wait_interval=0.5, @listener=nil, @direct_connect=true, @device=:ios, @http_client=#<Appium::Http::Default:0x00000001089aec38 @open_timeout=nil, @read_timeout=nil, @additional_headers={}, @server_url=#<URI::HTTP http://127.0.0.1:4723/wd/hub/>, @common_headers={"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.23.0 (ruby macosx)"}, @proxy=nil, @http=#<Net::HTTP 127.0.0.1:4723 open=true>>, @driver=#<Appium::Core::Base::Driver:0x435b8d9f97731d0 browser="unknown">>, @caps=#<Appium::Core::Base::Capabilities:0x000000010890f138 @capabilities={:platformName=>:ios, :udid=>"C942CC95-20A0-4348-A88C-692811C1F4AF", :automationName=>"Flutter", :bundleId=>"com.example.myDemoAppFlutter", :newCommandTimeout=>0}>, @custom_url=nil, @default_wait=0, @appium_port=4723, @appium_wait_timeout=30, @appium_wait_interval=0.5, @listener=nil, @appium_device=:ios, @automation_name=:flutter, @appium_debug=false, @sauce=#<Appium::SauceLabs:0x00000001089a6268 @username=nil, @access_key=nil, @endpoint="ondemand.saucelabs.com:443/wd/hub">, @sauce_username=nil, @sauce_access_key=nil, @sauce_endpoint="ondemand.saucelabs.com:443/wd/hub", @driver=#<Appium::Core::Base::Driver:0x435b8d9f97731d0 browser="unknown">, @http_client=#<Appium::Http::Default:0x00000001089aec38 @open_timeout=nil, @read_timeout=nil, @additional_headers={}, @server_url=#<URI::HTTP http://127.0.0.1:4723/wd/hub/>, @common_headers={"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.23.0 (ruby macosx)"}, @proxy=nil, @http=#<Net::HTTP 127.0.0.1:4723 open=true>>, @appium_server_status={"ready"=>true, "message"=>"The server is ready to accept new connections", "build"=>{"version"=>"2.11.2"}}>
@bridge = driver.bridge
^^^^^^^
It's failing on this line of code in the appium_flutter_finder gem. But I haven't been able to figure out how to actually use this code? I want to be able to click on an element by the semantic id, but this seems super complicated. Thanks!
Upvotes: 0
Views: 22