Hey guys, I'm using Selenium RC to do some kind of test now. And the driver I use is python. But now I am faced with a problem, that is: every time Selenium RC is launched and the URL is opened, it opens 2 windows, one for logging and the other for displaying HTML content. But I cannot close them all in a script.
here is my script:
from selenium import selenium
def main():
sel = selenium('localhost', 4444, '*firefox', 'http://www.sina.com.cn/')
sel.start()
try:
sel.open('http://www.sina.com.cn/')
except Exception, e:
print e
else:
print sel.get_title()
sel.close()
sel.stop()
if __name__ == '__main__':
main()
It is very easy to understand. I really want to close all the windows that selenium opens. I tried close () and stop (), but they all do not work.
source
share