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 trialJohan Lindstrom
971 Pointsneed help with automation test
tried to follow the video , using Visual code editor and followed every single line but when I try to run it , and it will error. Must be something missing , node_modules?
Pls help me so I can keep up.
J
Johan Lindstrom
971 PointsThis error is from my terminal.
Johans-MacBook-Pro:selenium-basics johanlindstrom$ ls
index.js node_modules
Johans-MacBook-Pro:selenium-basics johanlindstrom$ http://port-80-l1qbbi2ceo.treehouse-app.com/ node index.js
-bash: http://port-80-l1qbbi2ceo.treehouse-app.com/: No such file or director
If I use the Visual Studio Terminal. It's a different error. see below.
Johans-MacBook-Pro:selenium-basics johanlindstrom$ URL=http://port-80-l1qbbi2ceo.treehouse-app.com/ node index.js
/Users/johanlindstrom/Development/Treehouse/selenium-basics/node_modules/selenium-webdriver/lib/promise.js:2634
throw error;
^
WebDriverError: unknown error: 'url' must be a string
Craig Dennis
Treehouse TeacherOn the terminal one you forgot to prefix it with URL=
Johan Lindstrom
971 PointsI changed this line.
//driver.get(process.env.url);
To driver.navigate().to("http://port-80-l1qbbi2ceo.treehouse-app.com/");
Opened up the page now :)
Craig Dennis
Treehouse TeacherAhh I see the other error Johan!
driver.get(process.env.url);
That URL is all uppercased when you set the environment variable, so you need to
driver.get(process.env.URL);
Johan Lindstrom
971 PointsOh.. ? I'll try and keep u posted. Thx Craig
1 Answer
Mohammed Ismail
7,190 PointsCraig Dennis Hi,
I am also facing the same issue. I am using windows system.
When I set the environment variable before running index.js, I get --> WebDriverError: unknown error: 'url' must be a string error when using VS code. But if i embed the URL in code just like Jonathan did above, it works.
Can you tell me how I can solve this problem.
Craig Dennis
Treehouse TeacherCraig Dennis
Treehouse TeacherCan you paste the error please?