Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

AJAX load + element replace (sometimes) fails #13881

Closed
drauch opened this issue Jan 11, 2016 · 14 comments
Closed

AJAX load + element replace (sometimes) fails #13881

drauch opened this issue Jan 11, 2016 · 14 comments

Comments

@drauch
Copy link

drauch commented Jan 11, 2016

After AJAX requests (where the result is supposed to replace the contents of a div) we sometimes (race condition in the PhantomJS code base?) run into the situation, that PhantomJS (yeah, never happens with ChromeDriver or InternetExplorerDriver) thinks the AJAX result is the complete new page.

We can observe this behavior by taking a browser screenshot with PhantomJS and we can see only the AJAX result, nothing else. This is true even after waiting for 5s and taking another screenshot. Subsequent test stepts fail with NoElementFoundExceptions (as we search for elements outside of the AJAX result...).

This is reproducible in around 50% of the runs, the other 50% do not have the problem and the browser screenshot shows the whole page.

Any ideas?

We're using PhantomJS 2.0.0 on .NET 4.6.1, Win 8.1 via Selenium WebDriver.

@drauch drauch changed the title AJAX load & element replace (sometimes) fails AJAX load + element replace (sometimes) fails Jan 11, 2016
@vitallium
Copy link
Collaborator

Thank you for submitting this ticket!

This issue tracker primarily serves as the tool to report and track bugs, defects, and development tasks.
For general question, code review request, build problem, or other related discussion, please post it to either:

If you have not read it yet, please check also a few tips on Effective Q&A.

@drauch
Copy link
Author

drauch commented Jan 14, 2016

as the tool to report and track bugs

This is certainly a bug in PhantomJS, it looks like a race condition within PhantomJS.

@vitallium
Copy link
Collaborator

Sorry, but without a minimal test case or an example we can't help you in your situation. Thanks!

@drauch
Copy link
Author

drauch commented Jan 14, 2016

I'm aware that race conditions are hard to find, and that you won't be able to do very much about my filed bug if you don't fancy intense debug sessions and/or parallel flow analysis.

That doesn't change the fact that I reported a legit bug which should not be closed as long as it is not fixed. Closing the bug gives the idea that the problem does not exist. It hinders other people in similar situations to find the issue, etc.

If I ever find a minimal test case I most probably already found the concrete race condition in the PhantomJS code, I would probably provide a pull request instead.

Please keep bug reports open if they are valid bug reports, it is not only disrespectful but also a bad decision to prematurely close issues in open source projects. Thank you.

@vitallium
Copy link
Collaborator

I surely understand your position. We have enormous amount of issue here due to incredibly small amount of developers in the team.
We decided to keep the bug tracker as tidy as it possible.

Your issue is about random race conditions, without a simple test case. A test case that we could use to reproduce described race condition or at least to try.
It's hard to fix issues that are:

  • occur randomly
  • happens only in particular environment
    And, unfortunately, without a reproducible sample nobody will work on it.

Thanks!

You can find more information here: #13865

@vitallium vitallium reopened this Jan 14, 2016
@vitallium
Copy link
Collaborator

@drauch you'll be laughing at me. But I think I found the problem of your issue.

@drauch
Copy link
Author

drauch commented Jan 18, 2016

@vitallium: Not laughing, would love to see this fixed. Had lost all hope before 👍

Edit: if you don't plan to fix this issue anytime soon due to time problems, we would be glad to hear more about the problem. Maybe we can provide a PR ourselves.

@vitallium
Copy link
Collaborator

Could you please check version from master? It should be fixed now.

@drauch
Copy link
Author

drauch commented Jan 25, 2016

Is there a pre-built .NET assembly or do I have to compile phantomjs myself in order to test it?

@vitallium
Copy link
Collaborator

We have released a new version yesterday. This version includes the fix - https://bitbucket.org/ariya/phantomjs/downloads

@drauch
Copy link
Author

drauch commented Jan 25, 2016

👍 going to give it a try asap!

@drauch
Copy link
Author

drauch commented Jan 25, 2016

Unfortunately, the problem isn't fixed. 2.1.1 still gives us screenshots of the AJAX-response only.

@drauch
Copy link
Author

drauch commented Jan 25, 2016

(on another note: when testing for a 404 page, we also get a screenshot of the previously visited page instead of a 404 page)

@zackw zackw modified the milestones: Release 2.1, Release 2.2 Feb 3, 2016
@ghost ghost removed In progress labels Jan 10, 2018
@ghost ghost removed this from the Release 2.2 milestone Jan 10, 2018
@stale stale bot added the stale label Dec 25, 2019
@stale
Copy link

stale bot commented Dec 28, 2019

Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants