Skip to content
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

[IOS]Cannot interactive element with app native embedded flutter #63

Closed
HoLeAnh opened this issue Feb 26, 2020 · 10 comments
Closed

[IOS]Cannot interactive element with app native embedded flutter #63

HoLeAnh opened this issue Feb 26, 2020 · 10 comments

Comments

@HoLeAnh
Copy link

HoLeAnh commented Feb 26, 2020

My app be wrote in native and some page be embedded flutter, when go to flutter page i cannot interactive with element byValueKey

Environment :

  • IOS xcuit
  • Simulator : 13.3
  • Appium 1.16

Code:
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "13.3");
caps.setCapability(MobileCapabilityType.UDID, "03249794-5B26-4F67-88B4-AEE03BE4CC8D");
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "iphone");
caps.setCapability("bootstrapPath", ConfigData.bootstrapPath);
caps.setCapability("agentPath", ConfigData.agentPath);
caps.setCapability("bundleId", GlobalData.IOS_Sendo_bundleId);
caps.setCapability("unicodekeyboard", true);
caps.setCapability("useFirstMatch", true);
driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), caps);
.
(Do some action of native app)
.
.
Sleep(10000);
FlutterFinder find = new FlutterFinder((RemoteWebDriver) driver);
MobileElement addressButton = find.byValueKey("action_payment_method");
addressButton.click();

Error:
Exception in thread "main" org.openqa.selenium.StaleElementReferenceException: An element command failed because the referenced element is no longer attached to the DOM
For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/stale_element_reference.html
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'nhungs-Mac-mini.local', ip: '192.168.120.65', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_221'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {agentPath: /usr/local/lib/node_modules..., automationName: XCuiTest, bootstrapPath: /usr/local/lib/node_modules..., browserName: , bundleId: com.sendo.sendobuyer, databaseEnabled: false, deviceName: iphone, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, platform: MAC, platformName: iOS, platformVersion: 13.3, takesScreenshot: true, udid: 03249794-5B26-4F67-88B4-AEE..., unicodekeyboard: true, useFirstMatch: true, webStorageEnabled: false}
Session ID: fba4721a-361b-42af-a4b0-4e30f90e917f
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:276)
at io.appium.java_client.DefaultGenericMobileElement.execute(DefaultGenericMobileElement.java:45)
at io.appium.java_client.MobileElement.execute(MobileElement.java:1)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83)
at test1.main(test1.java:64)

@HoLeAnh HoLeAnh changed the title Cannot interactive element with app native embedded flutter [IOS]Cannot interactive element with app native embedded flutter Feb 26, 2020
@HoLeAnh
Copy link
Author

HoLeAnh commented Feb 26, 2020

appium-server-logs.txt
Full log appium

@shibupanda
Copy link
Collaborator

@HoLeAnh As I can see in the logs there is no such request "find.byValueKey("action_payment_method");" coming to the server and the beta appium-flutter-driver has been release with appium 1.16.0.

@HoLeAnh
Copy link
Author

HoLeAnh commented Feb 27, 2020

I don't know why there is no request find element : "action_payment_method" .
But in my code i already find it, you can let me know where i am wrong ? @shibupanda

MobileElement addressButton = find.byValueKey("action_payment_method");
addressButton.click();

@ahashmi24
Copy link

@HoLeAnh
In order to interact with flutter elements, you have to use AutomationName as 'FLUTTER' in place of 'IOS_XCUI_TEST' and also you need to switch the driver context to 'Flutter' view before interacting with flutter elements or 'Native' for native elements respectively.

@HoLeAnh
Copy link
Author

HoLeAnh commented Feb 27, 2020

@ahashmi24 my app is native and some page be embedded flutter, if i start driver with AutomationName as 'FLUTTER' my test cannot run.

@HoLeAnh
Copy link
Author

HoLeAnh commented Feb 28, 2020

@shibupanda there are any solution for my problem ?

@pferdalburakcinar
Copy link

pferdalburakcinar commented Feb 28, 2020

@ahashmi24 my app is native and some page be embedded flutter, if i start driver with AutomationName as 'FLUTTER' my test cannot run.
I have the same problem. Please inform me if you find the solution.

@chughrahul
Copy link

@shibupanda @ahashmi24
I'm having the same issue, my app is native and some views embedded flutter. If I start driver with AutomationName 'Flutter', it shows error. Is there any solution for this ?

@KazuCocoa
Copy link
Member

Technically, if Observatory listening on http://xxxxx system log was in the system log, this driver does not work since it means probably Dart VM does not expose its port.

@KazuCocoa
Copy link
Member

Please check logcat/system log if they have Observatory listening on http://xxxxx.
If Flutter officially did not provide tests for embedded components, this does not work as this driver as well.
(I have no idea...)


Please create a new issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants