Comments (8)
Hey,
It seems like this (dealing with ajax) is a common issue for automated javascript testing frameworks. I'm not all that familiar with selenium, so you might want to take my advice with a grain of salt.
Is there a way to fix this without changing hundreds of lines in my test suites?
It might be possible for you to extend Selenium with your own custom code, but even then, you'd probably still have to change the syntax of your tests in some way.
If not, is there a reliable selenium method that can test that a turbolinked page has fully loaded?
Again, you might be able to write your own, but as far as native functions go, I'd think your best bet would be to use the waitForElement function. So your example would look something like this:
Open /
click link=Sign in
waitForElement id=session_email
type id=session_email [email protected]
Would that work?
from turbolinks-compatibility.
I will get in contact with the Selenium project and see if there is any interest in extending the code.
I will try the waitForElement and let you know the result.
Chris
from turbolinks-compatibility.
Hi
I tried the waitForElement but it is not valid Selenese. However, it led me to the waitForElementPresent command, which is valid and appear to do the same thing. In one of my test suites, I added this command after every clickAndWait (as indicated in the previous comment) and it worked in every case, apart from one place. This was the only place I have javascript, and it was a standard confirm after delete command. So the code looked like:
clickAndWait link=Delete
waitForElementPresent Are you Sure?
assertConfirmation Are you Sure?
and the waitForElementPresent could not find the "Are you Sure".
I deleted the waitForElementPresent line just at this place in the test i.e it the code went back to
clickAndWait link=Delete
assertConfirmation Are you Sure?
and the test passed. However, I am not sure if this is reliable, or whether waitForElementPresent is not neeed with the Javascript confirmation?
Overall it looks like this is on the right track, although the Selenium IDE loses much of its spontanaity as it is no longer possible to make and edit a test suite by recording mouse clicks when running turbolinks. I will take this up with the Selenium project.
Chris
from turbolinks-compatibility.
In my suggestion, I changed the clickAndWait command to just click because the waiting will be done on the next line. I don't know if that helps or changes anything, but it seems more logical to me.
I would think that the waitForElementPresent Are you Sure?
command wouldn't work because the text isn't an element. Isn't there a waitForTextPresent
command that would be better?
from turbolinks-compatibility.
You are correct, there is a waitForTextPresent
command. However, this did not help. When I put it in, the test stalled at that point, and if I looked at the browser I could not see the delete confirmation message. Somehow the waitForTextPresent
seems to be stopping or delaying the display of the confirmation. If I take out the waitForTextPresent
it works fine. I wonder given it is a javascript message, whether the clickAndWait
is sufficient?
You are correct about click
being sufficient when followed by the waitForElementPresent
.
I have posted a new topic concerning Turbolinks on the Selenium User group but have yet to have a response.
from turbolinks-compatibility.
Yeah, you're right, waitForTextPresent
wouldn't work. If you take a look at the documentation here, I think you'll see that how you're doing it is sufficient.
I would think that how you have your tests now is how you should keep them. You wouldn't want them to be tailored for Turbolinks. You'd want them to pass regardless of whether Turbolinks is enabled.
from turbolinks-compatibility.
OK, then I understand an approach to make the Selenium IDE work under turbolinks. The only problem is that by the time I change all my tests, I will be so familiar with the Selenium language, then I may as well just work with Selenium language directly rather than work with IDE replay facility. But I guess we all have to grow up sometime.
Thank you for your help. I will post a summary, pointing to this issue report, on my Stack Overflow Turbolinks/Selenium question. If the Selenium project comes up with any information on this I will let you know.
from turbolinks-compatibility.
You're welcome. I'm glad I could help you.
from turbolinks-compatibility.
Related Issues (20)
- Turbolinks not working with google ads or LiveHelpNow
- Google Tag Manager HOT 5
- Facebook like/share button still disappearing HOT 1
- Marketo munchkin tracker integration request
- Integration with Google TagManager HOT 4
- Happyfox Chat loading problem after language change HOT 4
- Can't find a way to change Facebook language HOT 1
- Loading Javascripts Problem HOT 1
- React Native HOT 1
- Turbolinks 5 compatibility HOT 8
- Should the solutions propose both coffee script and standart js version?
- Segment.com HOT 1
- Olark Hummingbird theme
- New Sharethis implementation and Turbolinks' incompatibility HOT 3
- owlCarousel not Loaded
- Zendesk old and new tab displayed HOT 2
- Turbolink 5 and Google DFP not working
- LiveZilla Compatability
- Using the Freshdesk/Freshdesk Widget with Turbolinks HOT 4
- SaleForce Widget with turbolinks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbolinks-compatibility.