Тестирование
веб-приложений в браузере, автомагически.
Example of capturing
a screenshot from Selenium WebDriver in Python:
#!/usr/bin/env python from selenium import webdriver browser = webdriver.Firefox() browser.get('http://www.ubuntu.com/') browser.save_screenshot('screenie.png') browser.quit()
А как быть,
если надо в консоли?
The problem is that
my Jenkins CI server has no display, so I must run my GUI tests in a
headless X-server.
A colleague pointed
me to PyVirtualDisplay, a Python wrapper for Xvfb and Xephyr
#!/usr/bin/env python from pyvirtualdisplay import Display from selenium import webdriver display = Display(visible=0, size=(800, 600)) display.start() # now Firefox will run in a virtual display. # you will not see the browser. browser = webdriver.Firefox() browser.get('http://www.google.com') print browser.title browser.quit() display.stop()
original post http://vasnake.blogspot.com/2013/11/headless-selenium-webdriver.html
Комментариев нет:
Отправить комментарий