These are chat archives for rosshinkley/nightmare

19th
Jan 2017
Tamir Twina
@TamirTwina
Jan 19 2017 15:22
Anyone know how to resolve "an error has occurred: Cannot read property 'focus' of null" .. simply trying to type into a textbox , nothing special
using the latest nightmare version
johnferro
@johnferro
Jan 19 2017 18:35
@TamirTwina This is most likely caused by the selector you are trying to type into not being present on the page. Focus gets called on it before the typing occurs, see this function (https://github.com/segmentio/nightmare/blob/master/lib/actions.js#L177). For example you would get the same error by opening up your console in chrome and running document.querySelector('.random-gibberish').focus(); so the first thing I would do is double check the selector you are using compared with the DOM that is present when you are trying to type.