-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console message before driver.start() throws "Cannot read property 'getItem' of null" #1875
Comments
Hi @caseyWebb, Thanks for your report and the PR! |
I was wondering that myself when taking a second look at the code to be honest. It's testing a part of our app that is way before my time and I'm unfamiliar with, but it does use iframes heavily. I'll email you the link + login to check it out yourself. |
Thanks, I've got your mail. |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
…evExpress#1914) * Test added * Iframe driver fixes (closes DevExpress#1842, closes DevExpress#1875) * Formatting * Change child driver link default timeout * Formatting * Update test name
Are you requesting a feature or reporting a bug?
Bug
What is the current behavior?
Event listeners in the driver which depend on contextStorage are registered before contextStorage is initialized, so if a JS error or console message is emitted before
driver.start()
is called, an error is thrown.What is the expected behavior?
No errors.
How would you reproduce the current behavior (if this is a bug)?
Emit a console message on page load. IDK what/when driver.start() is called from just poking around, but as long as it's before that, it's reproducible.
Provide the test code and the tested page URL (if applicable)
Tested page URL: Can share privately, if necessary.
Test code
Specify your
In my poking around to make sure that the error was in TestCafe and not my code, I was able to fix this w/ trivial changes — the context storage just needs to be initialized in the constructor, before the event listeners are registered. If I'm missing something that prevents the initialization in the constructor, the event listeners could alternatively be registered in the
start
method.The text was updated successfully, but these errors were encountered: