Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Quality Assurance Introduction to Selenium Automation Nation Page Object Model

john reaser
john reaser
440 Points

cannot read property 'get' of undefined

/selenium-basics/pages/home.js:18 this.driver.get(process.env.URL); ^

I've gone over this line by 5 times now and everything is exactly the same as presented. Any idea whats happening?

1 Answer

Simon McGuirk
Simon McGuirk
2,673 Points

Are you still setting the environment url in the command line when you run the file?

E.g: URL="http://port-80-xxxxxxxxxx.treehouse-app.com/" node index.js

The error suggests process.env.URL has not been set so it doesn't know what to get/open in the browser.