是否可以从UIAutomation调用call服务
在此网页http://www.geonames.org/export/ajax-postalcode-autocomplete.html上,可以输入国家和邮政编码,并得到以下响应
http://api.geonames.org/postalCodeLookupJSON?postalcode=2830&country=DK&username=demo
{"postalcodes":[{"postalcode":"2830","countryCode":"DK","lng":12.4666667,"placeName":"Virum","lat":55.8}]}我对此相当陌生,有没有一种方法可以用参数调用服务,或者自己构建url并调用它,然后在UIAutomation中获得作为JSON的响应?
发布于 2015-06-25 01:37:47
你可以这样做:
var result = target.host().performTaskWithPathArgumentsTimeout("/usr/bin/curl", ["http://yoururl"], 30);
var json = JSON.parse(result.stdout)https://stackoverflow.com/questions/19836507
复制相似问题