calabash / calabash-ios-server

An embedded HTTP server for performing queries and test automation
Other
87 stars 82 forks source link

LPServer: incorrectly parsing XPATH JSON error Dictionary as Array #430

Open jmoody opened 6 years ago

jmoody commented 6 years ago
# LPWebQuery

// When output is a JSON Dictionary
49  NSString *output = [webView calabashStringByEvaluatingJavaScript:jsString];

// query result is nil
 51 NSArray *queryResult = [LPJSONUtils deserializeArray:output];

CalWebView-cal[449]  DEBUG LPMapRoute:134 | Map POST, /map Parsed UIScript as
    (
        "view:'WKWebView'",
        "with xpath:'hr#green_stripe'"
    )
CalWebView-cal[449] DEBUG LPJSONUtils:107 | Unable to deserialize  
{
     "error":"Exception while running query: hr#green_stripe",
    "details":"Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51"
}
LPServer should detect this error and return an error result.