Forum Discussion

mfoster711's avatar
mfoster711
Regular Contributor
8 years ago

Determine if Javascript is running?

Our test website has a link that flashes to alert the user of certain conditions. It appears the class for the link is changing back and forth every second to make the link flash. I assume there is some type of javascript running to cause the class name to toggle back and forth.

 

Any tips on how to test this? What should I even look for? Can I tell if Javascript is running to cause this to flash?

3 Replies

  • I have a few tests which check for flashing text on web sites.

     

    The devs set the colour to change every second. So I simply poll the object for 2 seconds, checking the colours continuously, it keeps a note of all the results it gets. Which will be either 2 or 4. Background and foreground colours. If it finds two of each, that's my flashing colours. So my little function for testing this takes in whether it should be flashing or static, and which colour(s) it should find. (as RGB values)

     

    What is it you need to test?

     

    If you just need to click it, you should just be able to wildcard out the additional classing on the button as it flashes to get to it.

    • mfoster711's avatar
      mfoster711
      Regular Contributor

      I need to verify it is flashing. We were thinking of doing something similar where we keep checking for the class to alternate between two values. I just was wondering if there was a better way.

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        Not that I found.

         

        But there was no class indicators for me. Simply the RGB values changing. So a poll double the length of the flash interval (to be 100% sure you'll catch it) was the way to go.