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.
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_keys
under it?
Also, it is said that the method is not defined in the error description.
When inspected, the return value offind_elements
looks 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
# 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
-
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
Related articles
- ruby - i want to know the reason for implementing it in a class method or module when solving an exercise
- c # - what does the error "argumentexception: method return type is incompatible" mean?
- javascript - js:to refer to the object that executed the method in the callback function
- ruby - binary data conversion method
- ruby - no method error rails
- ruby - i'm using the errors method, but i don't get an error message
- ruby on rails: undefined method ʻuser'for nil: about nomethoderror of nilclass
- ruby - undefined method `save'for nil: nilclass cannot be resolved
- ruby - [rails] when rails s is executed, an error "cannot load database configuration" appears and it is forcibly term
- ruby - improvement of nomethoderror undefined method `paginate'
- [ruby] "attr_accessor" i don't understand this method
- ruby on rails - [rails] i want to make it a helper method
- ruby - nomethoderror: undefined method `new'for: uglifier: symbol error on heroku deployment
- ruby on rails - [rails] i want to use each statement in a helper method
- the ruby on rails each method does not repeat well
- ruby on rails - i want to use yield in a method chain
- ruby - returns the method further as a method
- ruby - where method doesn't work
- ruby - undefined method `build_address' for order (table doesn't exist): class send data to db
- ruby on rails5 nomethoderror (undefined method `cart_items' for nil:nilclass) implementation of ec site cart function
- Become Net :: ReadTimeout when connecting with REMOTE with RUBY
- css - sassc :: syntaxerror
- i want to get the response header with ruby + selenium webdriver + proxy
- ruby - unable to deploy to heroku
- ruby - unable to deploy to heroku (nomethoderror)
- javascript - how to operate the web application automatically
- ruby - i can't pod install on mac (m1)
- ruby - homebrew install does not succeed
- ruby - all rails gems are not installed
- ruby - i can't install 270 with rbenv
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.