Stackoverflow has a good answer to this question.

http://stackoverflow.com/questions/19282549/web2py-testing-with-selenium-webdriver

I am working the tutorial now and these changes worked for me...

def test_has_right_title(self):        
        # First he looks at the topbar and sees 'Microposts On Steroids'
        title = self.browser.title
        self.assertEqual('Microposts On Steroids', title)

def test_has_right_title(self):
        # First he looks at the topbar and sees 'Tukker.Me Privacy Policy'
        title = self.browser.title
        self.assertEqual('Tukker.Me Privacy Policy', title)

def test_has_right_title(self):
        # First he looks at the topbar and sees 'About Tukker.Me'
        title = self.browser.title
        self.assertEqual('About Tukker.Me', title)

Have fun..

On Friday, June 28, 2013 4:25:20 AM UTC-7, [email protected] wrote:
>
>  I tried what you suggested, but it gave the same error. :(
>
> On Tuesday, June 25, 2013 8:24:48 PM UTC+5:30, dhmorgan wrote:
>>
>> you're welcome; I'd been wanting to run through the tutorial, 
>>
>> yes,within test_static_pages.py (though I guess you've probably tried it 
>> by now) it will work that way; I don't know selenium well enough to say 
>> whether his example "should" work or whether browser.title is the preferred 
>> way; I'd comment to him on the site but it's taken over by spammers
>>
>> On Tuesday, June 25, 2013 4:08:25 AM UTC-5, [email protected] wrote:
>>>
>>> Thank you so much for responding Danny.
>>> Do you mean to say that I need to change the statement :"title = 
>>> self.browser.find_element_by_tag_name('title')"....  to...
>>>    "title = self.browser.title" ...??
>>>
>>> On Monday, June 24, 2013 12:12:20 PM UTC+5:30, [email protected] 
>>> wrote:
>>>>
>>>>
>>>> In the tukker application example given in the 
>>>> killer-web-development.com the "test_has_right_title" fails in-spite 
>>>> of having the exact code and steps followed according to the instructions 
>>>> on the website. 
>>>> The message I get after running the application is :
>>>>
>>>> FAIL: test_has_right_title (test_static_pages.TestPrivacyPage)
>>>> ----------------------------------------------------------------------
>>>> Traceback (most recent call last):
>>>>   File 
>>>> "/home/shailajack/Desktop/python_prog/web2py/applications/tukker/fts/test_static_pages.py",
>>>>  
>>>> line 18, in test_has_right_title
>>>>     self.assertEqual('Tukker.Me Privacy Policy', title.text)
>>>> AssertionError: 'Tukker.Me Privacy Policy' != u''
>>>>
>>>>
>>>> Can anyone please help me to figure out where I'm going wrong??
>>>>
>>>> Thanks
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to