Object.keys and hsOwnProperty js functions are not working in Karate version 0.9.5

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-28 21:09:30

问题


Previously i was using karate version 0.8.0. After migrating to 0.9.5 all of my functions where i am using Object.keys and hasOwnProperty starts giving me error TypeError: available.hasOwnProperty is not a function.

In above code available = { "123": { "57": 2 } }


回答1:


Yes these are not supported, as a general rule - use JS only for logic, we don't even advise using JS for loops: https://github.com/intuit/karate#loops

Please use the karate.keysOf() instead, and there are many more similar API-s for other cases.



来源:https://stackoverflow.com/questions/61137654/object-keys-and-hsownproperty-js-functions-are-not-working-in-karate-version-0-9

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!