Skip to content

Commit

Permalink
fix 无法输入问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyunpeng2 committed Dec 28, 2023
1 parent 1c91804 commit 270fa84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion WebDriverAgentLib/Commands/FBElementCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ + (NSArray *)routes
[[FBRoute POST:@"/wda/forceTouch"] respondWithTarget:self action:@selector(handleForceTouch:)],
#endif
[[FBRoute POST:@"/wda/keys"] respondWithTarget:self action:@selector(handleKeys:)],
[[FBRoute POST:@"/wda/keys"].withoutSession respondWithTarget:self action:@selector(handleKeys:)],
];
}

Expand Down Expand Up @@ -555,7 +556,10 @@ + (NSArray *)routes

+ (id<FBResponsePayload>)handleKeys:(FBRouteRequest *)request
{
NSString *textToType = [request.arguments[@"value"] componentsJoinedByString:@""];
NSString *textToType = request.arguments[@"value"];
if([request.arguments[@"value"] isKindOfClass:[NSArray class]]){
textToType = [request.arguments[@"value"] componentsJoinedByString:@""];
}
NSUInteger frequency = [request.arguments[@"frequency"] unsignedIntegerValue] ?: [FBConfiguration maxTypingFrequency];
NSError *error;
if (![FBKeyboard typeText:textToType frequency:frequency error:&error]) {
Expand Down

0 comments on commit 270fa84

Please sign in to comment.