python - selenium testing with django gives 'NoneType' object has no attribute 'path' -
i cannot see making error happen because not give me more information. tests pass, print message console. post files below.
tests.py:
class mainapptests(liveservertestcase): """testing interactions on main page""" def setup(self): """opening browser""" selenium_logger = logging.getlogger('selenium.webdriver.remote.remote_connection') # display possible problems selenium_logger.setlevel(logging.error) self.browser = webdriver.firefox() self.user = make_user() def teardown(self): """closing browser""" self.browser.quit() def test_homepage(self): """testing work""" self.browser.get(self.live_server_url) self.assertin("site", self.browser.title)
views.py:
def home(request): """view displaying home page""" if request.user.is_authenticated(): # pulling , ordering 'full_name' field, shows users available active_languages = language.objects.filter(active=true).order_by('full_name') context = {'active_languages': active_languages} return render(request, 'main/home_loggedin.html', context) return render(request, 'main/home_loggedout.html', status=302)
it's not you, it's selenium... :) code correct.
this recent issue selenium, happening python client during self.browser.quit()
.
updating selenium should trick. although due recent nature of bug (reported , fixed on 21th oct), @ moment, fix not yet incorporated recent version of selenium. should be fixed on versions above 3.0.1
Comments
Post a Comment