It’s important to take advantage of the cutting-edge technologies we are using at TeamMentor and make sure those technologies can be used to perform testing and improve the quality of the product.
Since at TeamMentor we rely on jQuery, it’s important to understand what a jQuery selector is and why are they useful and important. As decribed in the jQuery official page: “…jQuery offers a powerful set of tools for matching a set of elements in a document.”
As an example, if you would like to locate all the HTML heading 1 in a page, then the jQuery selector could be something like this : jQuery(“h1”).html(“Hello!”); or just $(“h1”).html(“Hello!”);.
Using jQuery Selector in TeamMentor via Firefox
Using firebug, this task is very easy, you will need to open firebug and then select the Console tab. At the bottom there should be a console window to enter some commands:
Now, let’s use the following selector to put some html on all the HTML heading 2: $(“h2”).html(“Hello TeamMentor!!”);
Look that after executing that command, all the h2 heading elements in the page constrains now the text “Hello TeamMentor!!”
From this stand point, we can use the power of jQuery selectors to locate elements in the DOM and make easy the testing.