开发者

Calling a Selenium Testcase in python

开发者 https://www.devze.com 2023-01-20 01:02 出处:网络
I\'m trying to run a selenium testcase in python. I have testcases that I can run direct开发者_JS百科ly from the command line no problem with

I'm trying to run a selenium testcase in python. I have testcases that I can run direct开发者_JS百科ly from the command line no problem with

python seleniumtest.py

However when I try to run it from within python it is failing.

__import__('seleniumtest')

seleniumtest.py ends with a command

unittest.main()

this command seems to fail when it gets run using the __import__ method. Does know why running this through the import is not working? For my purposes I cannot simply use popen.


You need to have something like this at the end of your selenium program:

if __name__=="__main__"
0

精彩评论

暂无评论...
验证码 换一张
取 消