Headless selenium. Will be useful to integrate with CI
Install virtual display and python wrapper for it:
Install virtual display and python wrapper for it:
$ sudo apt-get install xvfb xserver-xephyr
$ sudo pip install pyvirtualdisplay
Usage example: from pyvirtualdisplay import Display
from selenium import webdriver
"""visible=0, visible=1 for display or not virual display"""
display = Display(visible=0, size= (1024, 768))
display.start()
driver= webdriver.Chrome()
driver.get('http://www.qa-notes.blogspot.com')
print 'The title of current page is: ', driver.title
driver.quit()
display.stop()
No comments:
Post a Comment