THIS OCCURS IN FIREFOX ONLY: In a previous question, I had run into the issue where SST 0.2.4 is not compatible with Selenium 2.44.0. So I downgraded to Selenium 2.43.0. I now have a new issue that I'm confused about. I'm receiving the following error message:
_StringException: Traceback (most recent call last):
File "C:\Python27\lib\site-packages\sst\cases.py", line 75, in setUp
self.start_browser()
File "C:\Python27\lib\site-packages\sst\cases.py", line 107, in start_browser
logger.debug('Browser started: %s' % (self.browser.name))
AttributeError: 'NoneType' object has no attribute 'name'
The code that it is referencing in the cases.py file in the Lib/SST folder is below:
def start_browser(self):
max_attempts = 5
for nb_attempts in range(1, max_attempts):
try:
logger.debug('Starting browser (attempt: %d)' % (nb_attempts,))
self._start_browser()
break
except exceptions.WebDriverException:
if nb_attempts >= max_attempts:
raise
logger.debug('Browser started: %s' % (self.browser.name))
My code looks like the following:
import unittest
from sst.actions import *
from sst import cases, config, browsers
class TestMyTest(cases.SSTTestCase):
def test_mytestcase_home_page(self):
config.results_directory = "C:/Users/Brenda/test/SST-Test-Project/results"
go_to('http://www.myhomepage.com')
assert_title_contains('My Home Page')
take_screenshot(filename='home_page.png',add_timestamp=True)
assert_element(tag='a', text='Log in')
I keep thinking that the solution to this is fairly simple, but I can't seem to wrap my head around it.
I'll also add the note that when running sst-run MySSTTest in the command line, it looks like it is attempting to start the browser without success. My code was working prior to the holiday break at which time it seems to have broken.
EDITED 3-Dec-2014: I wanted to add that I can successfully execute the test in Chrome and IE. This issue is with Firefox ONLY in a Windows 7 environment. It was successfully executed on a Mac OS in all 3 browsers.
I think cases.py codes has possibility cannot get browser object when it runs _start_browser
method