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 trialStewart Haynes
Courses Plus Student 898 PointsCan't get this to work in Win10.
Works just fine when I keep everything in index.js. It's when I create the new class in the new directory and attempt to run, that I get this error. Anyone running Windows able to get this to work?
NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":"#registrar input[name = 'name'"} (Session info: chrome=61.0.3163.100) (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.15063 x86_64) at WebDriverError (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\error.js:27:5) at NoSuchElementError (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\error.js:176:5) at Object.checkLegacyResponse (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\error.js:529:15) at parseHttpResponse (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\http.js:509:13) at doSend.then.response (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\http.js:441:30) at process.tickCallback (internal/process/next_tick.js:103:7) From: Task: WebDriver.findElement(By(css selector, #registrar input[name = 'name')) at thenableWebDriverProxy.schedule (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\webdriver.js:807:17) at thenableWebDriverProxy.findElement (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\webdriver.js:1014:17) at HomePage.addInvitee (C:\Users\Dana Scully\OneDrive\Selenium projects\home.js:19:21) at Array.forEach (native) at Object.<anonymous> (C:\Users\Dana Scully\OneDrive\Selenium projects\index.js:39:10) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) From: Task: WebElement.sendKeys() at thenableWebDriverProxy.schedule (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\webdriver.js:807:17) at WebElementPromise.schedule (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\webdriver.js:2015:25) at WebElementPromise.sendKeys (C:\Users\Dana Scully\OneDrive\Selenium projects\node_modules\selenium-webdriver\lib\webdriver.js:2178:19) at HomePage.addInvitee (C:\Users\Dana Scully\OneDrive\Selenium projects\home.js:20:14) at Array.forEach (native) at Object.<anonymous> (C:\Users\Dana Scully\OneDrive\Selenium projects\index.js:39:10) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12)
2 Answers
Craig Dennis
Treehouse TeacherI spot a typo:
{"method":"css selector","selector":"#registrar input[name = 'name'"}
Looks like you are missing that trailing hard bracket.
Hope that fixes it!
Stewart Haynes
Courses Plus Student 898 PointsIt was a typo, but the missing bracket didn't really affect it. I forgot to put parenthesis after homePage.open. Thanks much for the help!