-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Appium is slow #169
Comments
Your snippet was a little opaque to me; would you mind pasting your whole test including helper functions? For Appium tests, we "remember" indexes and treat them as part of the page source (i.e., they don't change), but if there's a faster way to do what you want (which sounds like it's "find an element by its text") we certainly want to add it instead of relying on brittle indexes. |
This is the whole test. The strings have been altered slightly. The need to manually invoke wait every time will go away once I work on it a bit more. I just got the test passing today. start = Time.now
wait { button('Sign In') }.click
wait { textfield('Email') }.send_keys 'my@email'
wait { secure_textfield('Password') }.send_keys 'password'
wait { button('Sign In', 2) }.click
wait { button('details') }.click
wait { text_include('my account') }.click
wait { button('Sign Out') }.click
alert_accept
puts "Finished in #{Time.now - start} seconds" The helper functions are defined in appium/ruby_console. |
I think the problem is > text_include('my account')
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/elements
{"using":"tag name","value":"text"}
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/88/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/89/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/90/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/91/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/92/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/93/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/94/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/95/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/96/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/97/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/98/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/99/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/100/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/101/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/102/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/103/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/104/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/105/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/106/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/107/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/108/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/109/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/110/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/111/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/112/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/113/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/114/attribute/name
null
get
session/f128e37b-ef35-4802-86f1-0a6addcfa9e1/element/115/attribute/name
null |
I got this working using UIAutomation directly. This example taps the first button that has a name containing 'Sign'. UIAutomation is instant compared to 28 seconds for this feature using WebDriver.
|
Closing this for now, but keep your eyes peeled for future enhancements that allow for greater speed while sticking within the WebDriver paradigm. |
The xpath feature fixed the slowness. It's almost instant now. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have a simple seven line test that logs in and then out of an app. It takes 53 seconds to run. One step iterates through almost 36 elements to find the appropriate value.
Is the best practice to discover elements via text and then save index numbers so subsequent runs are not slow?
The text was updated successfully, but these errors were encountered: