Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.