getSemanticsId method

Future<int> getSemanticsId (SerializableFinder finder, { Duration timeout })

Retrieves the semantics node id for the object returned by finder, or the nearest ancestor with a semantics node.

Throws an error if finder returns multiple elements or a semantics node is not found.

Semantics must be enabled to use this method, either using a platform specific shell command or setSemantics.

Implementation

Future<int> getSemanticsId(SerializableFinder finder, { Duration timeout }) async {
  timeout ??= _shortTimeout(timeoutMultiplier);
  final Map<String, dynamic> jsonResponse = await _sendCommand(GetSemanticsId(finder, timeout: timeout));
  final GetSemanticsIdResult result = GetSemanticsIdResult.fromJson(jsonResponse);
  return result.id;
}