Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I researched this as much as I could on my own but came to no clear conclusion to my question. I've been teaching myself automation testing via Python + Selenium, I'm as new or n00b as it gets so bare with me. I've come across this line in some of my tutorials:

self.assertIn but more like this, self.assertIn("Python", driver.title) and I've also seen it like this (simple use, not in unittest) assert "Python" in driver.title

... so far I've been able to grasp the tutorials, at least where my progress has taken me but I do not understand the function of this driver.title. Any help would be much appreciated.

Thanks in advance for your time.

share|improve this question

1 Answer 1

It is getting the title of the web page and seeing if it has Python in it.

How much HTML do you know?

share|improve this answer
    
Thank you for your comment, Phil. I know a bit of HTML, actually although python and selenium are very new to me. Does the title in the test have to match word-for-word the title in the browser? Thank you for your input. –  フレヂィ Feb 28 at 18:52
    
Also, what is the best place to find a complete or extensive guide to syntax. I've read through these links link and link but they just don't seem to have a complete library to read through, or maybe it's just my initial ignorance into this venture. –  フレヂィ Feb 28 at 18:58
    
See this thread for different ways of using the title - contains or exact - sqa.stackexchange.com/questions/7887/… –  Phil Kirkham Feb 28 at 20:03
    
Did you look here - and links from here - for basic webdriver info? docs.seleniumhq.org/docs/03_webdriver.jsp –  Phil Kirkham Feb 28 at 20:04
    
Thank you again, Phil. I guess it's just eagerness on my part. Wanting to take it all in. I forgot that the journey is just as important as the end. –  フレヂィ Feb 28 at 21:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.