【问题标题】:Execute Pyunit test on STAX Monitor在 STAX Monitor 上执行 Pyunit 测试
【发布时间】:2019-05-21 17:16:44
【问题描述】:

我在 STAX Monitor 上运行 Junit 测试或 Pyunit 测试时遇到问题。如何在 XML 中执行我的测试以在 STAX Monitor 上使用它。

<!DOCTYPE stax SYSTEM "stax.dtd">
<stax>
</script>
    <defaultcall function="main"/>
    <function name="main">
        <process name="'My Test Process'">
                <location>'local'</location>
                <command>'python'</command>
                <parms>cmdline</parms>
                <env>'C:\Users\X1>python -m unittest discover C:\Users\X1\test2 RegisterEmployeeTestRunner.py'</env>
                <stderr mode="'stdout'"/>
                <returnstdout/>
        </process>
    </function>
</stax>```

【问题讨论】:

  • 我也有同样的问题。1/ 在 cmd code python -m unittest discover C:\Users\anthony\Desktop\test\RegisterEmployee.py code 上开始你的 Pyunit 测试
  • 'local''python' cmdline'C:\Users\x>python -m unittest discover C:\Users\x\test2\RegisterEmployee RegisterEmployeeTestRunner.py'

标签: java python selenium-webdriver stax


【解决方案1】:

在 CMD 中运行你的测试

python -m unittest 发现 C:\Directory yourPyUnittest.py

【讨论】:

    【解决方案2】:

    在 STAX MONITOR 上运行 Punit 测试的 XML

    ```<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE stax SYSTEM "stax.dtd">
    <stax>
        <defaultcall function="FunctionA"/>
            <function name="FunctionA">
                <process>
                    <location>'local'</location>
                    <command>'python'</command>
                    <parms>'C:\Users\x>python -m unittest discover C:\Users\x\test2\RegisterEmployee RegisterEmployeeTestRunner.py'</parms>
                </process>
            </function>
        </stax>```
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多