question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

switching context to FLUTTER

See original GitHub issue

The problem

I do a driver.context("FLUTTER) and get a strange log output which shows that the context is not switched. But the flutter driver can work afterwards in flutter context.

Environment

  • Appium version (or git revision) that exhibits the issue: 2@beta27
  • Last Appium version that did not exhibit the issue (if applicable): n/a
  • Desktop OS/version used to run Appium: Mac
  • Node.js version (unless using Appium.app|exe): 14
  • Npm or Yarn package manager:
  • Mobile platform/version under test: iOS
  • Real device or emulator/simulator: emulator
  • Appium CLI or Appium.app|exe: CLI

Details

In the Log snippet below you can see that i do a getContexts and printing the current contexts into the log. Afterwards i change the context to FLUTTER, but the log says “switching from NATIVE to NATIVE” If i do a getContext, i get correctly “FLUTTER”

Link to Appium logs

2022-03-30 07:16:20:690 - [debug] [FlutterDriver@3c0f (27dab2e3)] Responding to client with driver.getContexts() result: ["NATIVE_APP","FLUTTER"]
2022-03-30 07:16:20:691 - [HTTP] <-- GET /session/27dab2e3-6a7c-4870-958a-774a1330ec12/contexts 200 93 ms - 34
2022-03-30 07:16:20:692 - [HTTP] 

2022-03-30 07:16:20:693 - NATIVE_APP

2022-03-30 07:16:20:693 - FLUTTER
2022-03-30 07:16:20:696 - [HTTP] --> POST /session/27dab2e3-6a7c-4870-958a-774a1330ec12/context
2022-03-30 07:16:20:697 - [HTTP] {"name":"FLUTTER"}
2022-03-30 07:16:20:698 - [debug] [FlutterDriver@3c0f (27dab2e3)] Calling AppiumDriver.setContext() with args: ["FLUTTER","27dab2e3-6a7c-4870-958a-774a1330ec12"]
2022-03-30 07:16:20:698 - [AppiumDriver@731e] Plugins which can handle cmd 'setContext': images
2022-03-30 07:16:20:698 - [AppiumDriver@731e] Plugin images is now handling cmd 'setContext'
2022-03-30 07:16:20:699 - [AppiumDriver@731e] Executing default handling behavior for command 'setContext'
2022-03-30 07:16:20:699 - [debug] [FlutterDriver] Executing Flutter driver command 'setContext'
2022-03-30 07:16:20:699 - [debug] [XCUITest] Attempting to set context to 'NATIVE_APP' from 'NATIVE_APP'
2022-03-30 07:16:20:699 - [debug] [XCUITest] Already in 'NATIVE_APP' context. Doing nothing.
2022-03-30 07:16:20:700 - [debug] [FlutterDriver@3c0f (27dab2e3)] Responding to client with driver.setContext() result: null

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Mar 30, 2022
0reactions
StephanB75commented, Mar 30, 2022

I don’t know. But i have no clue where i should report this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Navigate to a new screen and back - Flutter documentation
To switch to a new route, use the Navigator.push() method. The push() method adds a Route to the stack of routes managed by...
Read more >
Switch screen in flutter without context in flutter - Stack Overflow
I have this dart file(app_bar.dart) and am storing Appbars inside it and i have logged_home.dart file where am calling the app_bar.dart from.
Read more >
Is there a way to switch the capabilities between "Flutter" and ...
While switching context from flutter to Native app is working for me(using switchContext("NATIVE_APP")), but getting back to the Flutter context again is ...
Read more >
Working with Context in Flutter & React - digicradle.dev
Any UI change in a React or Flutter happens by changing a state value somewhere in the components hierarchy. We won't get into...
Read more >
Flutter In-Context Editing - Localizely
Instantly see how translated text appears on your device or in a browser with In-Context Editing for Flutter apps.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found