问题 This question already has answers here : How to close Dialog using FlutterDriver (2 answers) Closed 18 days ago . I am working with FlutterDriver, I have an IconButton defined and a key set as shown: Center( child: IconButton( key: Key('moredots'), icon: Icon(Icons.more_vert), onPressed: () { showDialog( context: context, builder: (_) => tableConfig, ); }, ), ) The dialog is successfully shown with the following code: await driver.tap(find.byValueKey('moredots')); What I can't figure out is