I have successfully setup appium for native app and looking for some help setting up appium for android mobile web testing using Ruby language.
Anyone have any examples or help me the configuration capabilities for android mobile web and rspec configuration or cucumber support/env.rb?
Receiving the following exception:
Could not determine your device from Appium arguments or desired capabilities. Please make sure to specify the ‘deviceName’ and ‘platformName’ capabilities
Make sure device is connected, USB debugging is on, and adb devices returns your device udid.
Basically, do adb devices in the command line and tell me what you get.
Thanks @kirill for the help. I finally got my device connected via USB and WiFi able to run appium mobile web tests using the chrome driver. I seriously need to improve the support/env.rb, but I was able to get it working.
require 'rspec/expectations'
require 'appium_lib'
require 'selenium-webdriver'
require 'timeout'
# Default URL
$mobileweb_url = 'http://google.com'
CAPS = {
'browserName' => 'Chrome',
'platformName' => 'Android',
'deviceName' => 'Samsung',
'platformVersion' => '4.4',
}
def server_url
"http://127.0.0.1:4723/wd/hub"
end
def driver
@driver ||= Appium::Driver.new(caps: CAPS)
@driver.driver
end
def appium_driver
driver #in case if still not initialized
@driver
end
def base_url(path)
$mobileweb_url + path
end
Before do
appium_driver.start_driver
end
After do
appium_driver.driver_quit
end
I also have similar problem. While searching on Google for the solution I come across this discussion.
In my case I have to test that app picks up the system language. So first I have to test FR, then RU and so on with 10-12 different locales.
How can I do that?
One thing that I can think of is to create 1 separate test file for each test and then run them in parallel. For each file I will put caps in Before function and quit driver in after function. These Before/After functions are test specific not global.
Now issue is I don’t know how to set caps in before function.