Closed alswl closed 8 years ago
Hi @alswl, I am not sure what you are asking here?
You can extract multiple values from the login request (multiple extractor declarations, using the set-cookie headers) and use them as variables in future requests. You can use multiple variables in templates for the POST requests. You can also (fun part) supply a 'vars' argument at the command line, which is parsed as a YAML dictionary of variables to use in the test.
Kind regards, Sam
Hi, thanks for your reply.
My question is, I must login in A domain, and test HTTP API in B domain.
I cannot extract A domain's cookie to B domain, because this command pyresttest SOME_DOMAIN SOME_TEST.py
only takes one domain.
The first argument is just a URL prefix, it should work with something like 'http://' as the basis, and then each test just defines the rest of the URL.
Or you can use the '--absolute-urls' command line argument - this will disregard any URL prefix you supply at the command line, and just use the URL or fragment defined in the tests themselves.
@alswl ^ answered above, that should solve your challenge.
Thanks, --absolute-urls
+ --vars
should solve my problem.
I'm using pyresttest in QA unit now.
And I occurred a question, this is my test case:
Now I can only pass one argument to command, so I cannot do the test case.
Thank you.