Answer the question
In order to leave comments, you need to log in
Why does selenium open about:blank and not the required page?
Hello.
I did a selenium test. I start the web server, I start the test. The browser opens, in the URL line - about:blank&utm_content=firstrun. Well, actually, there are no pages of the site.
The test itself:
from django.test import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class LoginTestCase(LiveServerTestCase):
def setUp(self):
self.selenium = webdriver.Firefox()
super(LoginTestCase, self).setUp()
def tearDown(self):
self.selenium.quit()
super(LoginTestCase, self).tearDown()
def test_login_webdriver(self):
selenium = self.selenium
#Opening the link we want to test
selenium.get('http://127.0.0.1:8000/auth/login/')
#find the form element
username = selenium.find_element_by_id('username')
password = selenium.find_element_by_id('password')
submit = selenium.find_element_by_id('submit')
#Fill the form with data
username.send_keys('testuser')
password.send_keys('testpass')
#submitting the form
submit.send_keys(Keys.RETURN)
Answer the question
In order to leave comments, you need to log in
The error of the author's version is that the conversion to a numeric type (plus sign) is behind the bracket, that is, it is performed after the comparison. And it is necessary to - first they led to numbers, then everything else.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question