You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MobileSelector. IOS_PREDICATE_STRING value is not accepted as a valid strategy for element identification #793
While automating for iOS Safari, I tried to use Predicate String strategy to identify the elements on a web page. I first tried to find the element with Appium UI and it worked fine and I was able to get element highlighted. The same I used in my code but it threw Unsupported strategy exception from the code. On debugging more using the Appium console in both the cases, I found that the "using" parameter sent in case of the Appium inspector and the value sent from the java_client are different. The inspector sends the value as "predicate string" that works fine. Whereas from the java_client code the MobileSelector has the value of IOS_PREDICATE_STRING as "-ios predicate string" that doesn't work.
Environment
java client build version or git revision if you use some shapshot: 5.0.0
Appium server version or git revision if you use some shapshot: 1.7.1
Desktop OS/version used to run Appium if necessary: Mac OS high Sierra (10.13.2)
Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: 1.2.7
Please create a gist with pasted stacktrace of exception thrown by java.
Link to Appium logs
Please create a gist which is a paste of your full Appium logs, and link them here. Do not paste your full Appium logs here, as it will make this issue very long and hard to read!
If you are reporting a bug, always include Appium logs as linked gists! It helps to define the problem correctly and clearly.
UPDATE: I noticed something weird. If I use autoWebview capability as true and before calling any findElement(s) set the context to NATIVE_APP then all the identification methods including the predicate string is working fine. Is this something expected or just stumbled upon some workaround for this?
Activity
priyeshkpandey commentedon Dec 19, 2017
UPDATE: I noticed something weird. If I use autoWebview capability as true and before calling any findElement(s) set the context to NATIVE_APP then all the identification methods including the predicate string is working fine. Is this something expected or just stumbled upon some workaround for this?