GithubHelp home page GithubHelp logo

execute commond error about har2case HOT 5 CLOSED

sirfengyu avatar sirfengyu commented on June 15, 2024
execute commond error

from har2case.

Comments (5)

debugtalk avatar debugtalk commented on June 15, 2024

@sirfengyu 可否将原始的HAR文件发来看下?

from har2case.

debugtalk avatar debugtalk commented on June 15, 2024

重新看了下HAR的标准规范,是我理解错了,这里的确是有个bug。

"postData": {
    "mimeType": "multipart/form-data",
    "params": [],
    "text" : "plain posted data",
    "comment": ""
}
mimeType [string] - Mime type of posted data.
params [array] - List of posted parameters (in case of URL encoded parameters).
text [string] - Plain text posted data
comment [string, optional] (new in 1.2) - A comment provided by the user or the application.

Note that text and params fields are mutually exclusive.

有些请求类型的postData中是text,有些是params,并且两者互斥。
之前只考虑了text这种情况,而你的案例中用的是params,我修复下吧。

from har2case.

debugtalk avatar debugtalk commented on June 15, 2024

@sirfengyu 我刚修复了下,你升级到最新版再试下。

from har2case.

sirfengyu avatar sirfengyu commented on June 15, 2024

还是同样的har文件:报如下错误

yudeMacBook-Pro:Downloads yufeng$ har2case demo.har demo.yml
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/har2case", line 11, in <module>
    load_entry_point('har2case==0.0.8', 'console_scripts', 'har2case')()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/har2case-0.0.8-py2.7.egg/har2case/cli.py", line 60, in main
    har_parser = HarParser(har_source_file, args.filter, args.exclude)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/har2case-0.0.8-py2.7.egg/har2case/core.py", line 63, in __init__
    self.testset = self.make_testset()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/har2case-0.0.8-py2.7.egg/har2case/core.py", line 296, in make_testset
    testset = self.make_testcases()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/har2case-0.0.8-py2.7.egg/har2case/core.py", line 275, in make_testcases
    {"test": self.make_testcase(entry_json)}
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/har2case-0.0.8-py2.7.egg/har2case/core.py", line 258, in make_testcase
    self._make_validate(testcase_dict, entry_json)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/har2case-0.0.8-py2.7.egg/har2case/core.py", line 219, in _make_validate
    resp_content_json = json.loads(content.decode('utf-8'))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

from har2case.

debugtalk avatar debugtalk commented on June 15, 2024

@sirfengyu 修复了,问题在于你测试系统的Content-Typeapplication/jose,这种情况之前是没有兼容的。现在已经好了。

from har2case.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.