Home>
[Introduction]

I am currently trying to run a simple automated test using appium.
The test itself is my first experience and I am fumbling, but I do not know much how to search and there are many old articles? The work is not easy to proceed.
Once the sample code worked, it stopped when I tried to do it myself.

[Current situation]

Steps obtained using appium desktop (source code)

[Download App->Enter Username->Enter Password->Log In]

I'm trying to run

, but
The app itself has been downloaded and opened, but no further processing is performed.
It seems that processing is running up tofind_elements, but hasn't the processing ofset_wait/send_keysunder it?
Also, it is said that the method is not defined in the error description.
When inspected, the return value offind_elementslooks likeSelenium :: WebDriver :: Element, but
Do I have to define it?
Can I use send_keys method from this return value?<-This is unlikely to happen
Or is there a completely different reason? ? ?
I am in trouble because I do not know the cause of the error.
I'm sorry that I couldn't understand the specifics, and the way I asked questions was ambiguous.
I would be grateful if you could teach. Thank you

[Current code]
# This sample code uses the Appium ruby ​​client
# gem install appium_lib
# Then you can paste this into a file and simply run with Ruby
require 'rubygems'
require 'appium_lib'

caps = {}
caps ["platformName"] = "Android"
caps ["automationName"] = "Appium"
caps ["platformVersion"] = "8.0"
caps ["deviceName"] = "Android Emulator"
caps ["app"] = "/Users/murayamakenta/Downloads/test/15.apk"
opts = {
    sauce_username: nil,
    server_url: "http://127.0.0.1:4723/wd/hub"
}
driver = Appium :: Driver.new ({caps: caps, appium_lib: opts}). start_driver

el1 = driver.find_elements (: id, "jp.studysapuri.android:id/username_V")
set_wait 10
el1.send_keys "gengoro4"
el2 = driver.find_elements (: id, "jp.studysapuri.android:id/password_V")
el2.send_keys "password"
el3 = driver.find_elements (: id, "jp.studysapuri.android:id/login_B")
el3.click
[Error description]
An error occurred while loading ./test_01.rb.
Failure/Error: set_wait 10
NoMethodError:
  undefined method `set_wait 'for main: Object
# ./test_01.rb:32:in `<top (required)>'
No examples found.

Finished in 0.00026 seconds (files took 13.42 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
  • Answer # 1

    It works when I wrote it in python.
    This problem is not a fundamental solution, but we will solve it because Python is likely to be used in the development environment, so we will proceed once.
    Thank you very much.

  • Answer # 2

    It works when I wrote it in python, so it looks pretty.
    This problem is not a fundamental solution, but we will solve it because Python is likely to be used in the development environment, so we will proceed once.
    Thank you