Highlight elements is one of my more popular plugins. I have just released a new version of this plugin. This release makes it compatible with the Selenium IDE v1.1. It also includes some refactoring to bring improvements from my latest plugins. You will get it automatically when AMO approves it. If you want it right now, you can get it directly from the version page on AMO.
There is a potential for test failures if they depend on the style attribute either directly or indirectly. Let me know if you face any issues with tests which fail only when highlight elements is on and pass successfully when highlight elements is off.
Is there a way to keep the thing highlighted (instead of flashing) so that a captureEntirePageScreenshot can capture the screen with the highlighting?
Hi Jason,
Usually, you would not want to leave the highlighted element on all the time. If you do, all accessed elements on the page would stay on. Why do you want to capture the screen with highlighting?
Cheers,
Samit
Hi Samit,
Thanks for asking.
What would be nice is a mode where all selected objects remain highlighted until a following captureEntirePageScreenshot is called which would then clear them all.
I use selenium scripts to capture workflow screenshots for a user manual and this would be very helpful. Currently, you have to explicitly call highlight and it only lasts until the next command is issued. If we had the above feature, one would be able to grab a single screenshot highlighting all the form fields that need to be entered. Or to work around the current bug that if you don’t select the parent frame right before a screenshot then it only grabs the selected frame (i.e. where the locator might live).
Thanks
Jason
Hi Samit,
I see that I was wrong about the “lasts only until the next command” part – I was adding “pause” always as my next command and that seems to clear highlighting.
So your plugin already goes a long way toward giving me what I want. Now I only have to manually add “highlight” commands right before doing screen changing actions (e.g. submit buttons)
Thanks again
Jason
Hi Jason,
Interesting use of Selenium! If your programming/googling skills are high, you can do this yourself. You can patch your copy of Selenium IDE as follows. Open the file htmlutils.js and find the highlight function, then change the last parameter of the window.setTimeout call from 200 to say 5000 or 10000 (its miliseconds for 5 seconds or 10 seconds). This should give enough time for your screen capture to take place. Patching done! Optionally, add a pause command after your screen capture in your test case to wait for the similar time so that the highlight gets turned off. You will need to google to see how to extract a firefox addon and so on, but it should be easy.
Cheers,
Samit
Hey. I wonder if this thread is still active???
I tried to change the setTimeout. But i couldn’t find the function in HilightElement.js. Instead I fount a setTimeout in pluginframework.js.
But that doesn’t work. Any suggestion???
By the way: Thanks for your Plugin. 😉
Hi Martin,
Have you thought about using my page coverage plugin? It might be what you are looking for. I mentioned “Open the file htmlutils.js and find the highlight function, then change the last parameter of the window.setTimeout call …”. Key points: htmlutils.js file, highlight function 😉
Cheers,
Samit
Thanks for the hint, Samit. I guess the deluxe option would be to implicitly add a highlight and captureEntirePage every time a clickAndWait happens, but I’ll take a look at the hints you gave me – I might be able to figure it out.
Regards
Jason
Hi Samit
If i want to write a selenium plugin,what languages should i use?
How can i do it?
How do you do it?
Thanks a lot.
LiaoWenjing
Hi LiaoWenjing,
The main language for Selenium IDE Plugins would be JavaScript, along with XUL if you want to make any user interface changes. Since a Selenium IDE Plugin is also a Firefox Addon, you will may require some information about XPCOM. You should browse through the documentation at http://seleniumhq.org/projects/ide/plugins.html, it will help you get started.
How I create plugins is not different from usual programming. I have given some talks on it and if you look around my blog you will find the slides and pieces of information throughout my posts.
Hope that helps. Feel to ask any specific questions you have on the comments or SeleniumAnswers.com (soon) or on the selenium developers discussion group.
Cheers,
Samit