question

WillUK avatar image
WillUK asked WillUK commented

Calling python script without the argument verbose

I guess this isn't really a bug, just a confusing inconsistent thing that is annoying.

When calling a python script (itest 7.2) through either cmd prompt or shell, when passing in large args it becomes attached to the response.

For example, if I call my script and pass in like a 50 lined JSON argument, it works fine. I only get back what my python program prints in a nice clean and easy xpathable way.

However, If I send like 400 lines, for some reason in my response I get back the command/file location all arguments as well as the 400 lines one then finally what my program prints, so when I go to regex/xpath my python prints it becomes hard and impossible with xpath.

It seems weird because I understand that its picking it up because technically it might see the input of the command as a print when it flashes in cmd prompt/shell but its a bit random that things below like 100 lines don't pop up. Could it be a time based thing? because it takes a little longer to process such a large argument, by the time it runs it things it must be a python print msg I care about?

Is there a way I can filter out the mess?

pythoncommand promptshell
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
cwhitty avatar image
cwhitty answered WillUK commented

I suspect this relates to your terminal width (Command Prompt Session Properties / Command / Terminal / Size). Probably when the command is not echoed in the response, the command length is less than this setting, and in cases where the command is echoed in the response, the command length is greater than this setting.

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

WillUK avatar image WillUK commented ·

Interesting, is there a way in itest to filter this out? I would assume not because in the eyes of itest its just a normal echo?

Or is there another way to grab prints off the script

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.