I'm using selenium from Python with the Phantomjs webdriver. I'm running both Selenium and my server locally on my laptop. When I run my test:
class TestNotLoggedIn(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
app.config['CSRF_ENABLED'] = False
self.driver = webdriver.PhantomJS()
def test_frontpage(self):
driver = self.driver
driver.get('localhost:5000')
print driver.page_source
it prints this html source:
<html><head></head><body></body></html>
Whereas, when I go to localhost:5000
in the browser, I get the full source of my page:
!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>MyWebsite</title>etc. etc.
Does anybody know what I'm doing wrong here?
ps. I've tried adding service_args=['--ignore-ssl-errors=true'])
as suggested here, but that makes no difference.