Thanks for making that change!  I'm just getting started, but something the 
below.

```
require 'byebug'
require 'watir-webdriver'

capabilities = {
  'browserName' => 'iOS',
  'platform' => 'Mac',
  'version' => '6.1',
  'app' => 
'/Users/admin/Downloads/CollectionView-Simple/build/Release-iphonesimulator/CollViewSmpl.app'
}

server_url = "http://0.0.0.0:4723/wd/hub";

begin
  wd = Selenium::WebDriver.for(:remote, :desired_capabilities => capabilities, 
:url => server_url)
  b = Watir::Browser.new wd
  b.element(:name, "Chicken Pics").click
  b.element(:name, "Chicken Calculator").click

  # Get the text of the button
  puts b.element(:xpath, "//window[1]/button[1]").attribute_value("name")

  # Run a calculation
  b.element(:xpath, "//window[1]/textfield[1]").when_present.send_keys "1"
  b.element(:xpath, "//window[1]/textfield[2]").send_keys "2"

  b.element(:name, "Calculate").click

  # Get the resulting value
  puts b.element(:xpath, "//window[1]/text[2]").text
rescue => e
  puts e.message
  puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}"
ensure
  b.close
end
```


---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-webdriver/issues/238#issuecomment-33526854
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to