<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Test Manager Blog &#187; tools</title>
	<atom:link href="http://www.thetestmanager.com/blog/category/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetestmanager.com</link>
	<description>One managers thoughts on Cyber Security &#38; the testing industry.</description>
	<lastBuildDate>Wed, 08 Sep 2010 10:21:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3222</generator>
		<item>
		<title>Verifying that the Text from a DataSource Exists in a WebTest Response VSTS</title>
		<link>http://www.thetestmanager.com/blog/2010/07/05/verifying-that-the-text-from-a-datasource-exists-in-a-webtest-response-vsts/</link>
		<comments>http://www.thetestmanager.com/blog/2010/07/05/verifying-that-the-text-from-a-datasource-exists-in-a-webtest-response-vsts/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 15:38:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[VSTS]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.thetestmanager.com/?p=267</guid>
		<description><![CDATA[I use Visual Studio Team Testers Edition everyday at work and one of the things that seemed really strange to me was that Microsoft had missed so many tricks when they decided to release it. Maybe they just decided to build in reasons for users to upgrade,  knowing that there will always be another version [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 222px"><img class="  " title="Visual Studio - VSTS Logo" src="http://www.thetestmanager.com/pics/Blog/Visual Studio Team System.jpg" alt="Visual Studio VSTS Logo" width="212" height="113" /><p class="wp-caption-text">Visual Studio Webtest Logo </p></div>
<p>I use Visual Studio Team Testers Edition everyday at work and one of the things that seemed really strange to me was that Microsoft had missed so many tricks when they decided to release it.</p>
<p>Maybe they just decided to build in reasons for users to upgrade,  knowing that there will always be another version of VSTS around the corner.</p>
<p>One of the things which is sorely missing is the ability to verify HTML source code against a datasource. Sure you can load a data source and then verify what is returned on the page when that row of the data-source is called however there is no functionality to check that the value of the row that you have submitted is returned somewhere in the HTML source (known as the response in VSTS).</p>
<p>So as per usual when you need something doing then, do it yourself, and hence I wrote a small piece of code that looks at the source code and then checks the value of the datasource row to make sure that the item you are submitting is returned in the HTML response.</p>
<p>All the data is dynamic from your source so you can&#8217;t just hard code validation rules, as there could be thousands of rows.</p>
<p>For an example take a Google search test. Imagine I want to check that my datasource of 10,000 records is retuned on every response.</p>
<p>So if I search for &#8220;<a target="_blank" href="http://www.thetestmanager.com/blog/goto/http://www.google.co.uk/#hl=en&amp;source=hp&amp;q=System+Testers&amp;btnG=Google+Search" title="Searching Google for System Testers"  target="_blank">System Testers</a>&#8221; as a parameter value</p>
<p>&#8220;Parameter Name = q&#8221; and</p>
<p>&#8220;Parameter Value = Google DataSource.Directory_03062010#csv.SearchParams&#8221;</p>
<p>In the above QueryString Parameter you can see</p>
<p>the Datasource is called  &#8220;Google DataSource&#8221;</p>
<p>the Actual FileName is &#8220;Directory_03062010&#8243; (and it&#8217;s a CSV file)</p>
<p>the Column name is SearchParams</p>
<p>I&#8217;ve commented my code to make it easier to understand however if you need any help just ask.</p>
<p><strong>Code Below. </strong></p>
<address>&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8216;Author  = Martin Hall<br />
&#8216;Purpose = To load text from a DataSource and then to compare that text<br />
&#8216;           against the source code on the page your testing.<br />
&#8216;Date = 07th June 2010<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Imports System<br />
Imports System.ComponentModel<br />
Imports Microsoft.VisualStudio.TestTools.WebTesting</p>
<p>Namespace RegressionSampleWebTestRules<br />
Public Class RegressionAllHeadingLocationsRule<br />
Inherits Microsoft.VisualStudio.TestTools.WebTesting.ValidationRule</p>
<p>&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8216; Specify a name for use in the user interface.<br />
&#8216; The user sees this name in the Add Validation dialog box.<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Public Overrides ReadOnly Property RuleName() As String<br />
Get<br />
Return &#8220;RegressionAllHeadingLocationsRule&#8221;<br />
End Get<br />
End Property<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8216; Specify a description for use in the user interface.<br />
&#8216; The user sees this description in the Add Validation dialog box.<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Public Overrides ReadOnly Property RuleDescription() As String<br />
Get<br />
Return &#8220;This should Compare text from a datasource parameter in a CSV file against the page sourcecode.&#8221;<br />
End Get<br />
End Property</p>
<p>&#8216; The name of the expected string<br />
Private ExpectedStringValue As String</p>
<p>Public Property ExpectedString() As String<br />
Get<br />
Return ExpectedStringValue<br />
End Get<br />
Set(ByVal value As String)<br />
ExpectedStringValue = value<br />
End Set<br />
End Property</p>
<p>&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8216; Validate is called with the test case Context and the request context.<br />
&#8216; These allow the rule to examine both the request and the response.<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Public Overrides Sub Validate(ByVal sender As Object, ByVal e As ValidationEventArgs)<br />
Try</p>
<p>Dim result2 As String<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8216;we only want request2 to match the source code on the returned web page.<br />
&#8216;the SourceCode could be different on the other pages.<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
result2 = (e.WebTest.Context(&#8220;Google DataSource.Directory_03062010#csv.SearchParams&#8221;).ToString())</p>
<p>&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&#8216;This should check the response for text<br />
&#8216;The text in question is the ParamValue we are supplying as new fake<br />
&#8216;parameter name and value<br />
&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>If e.Response.BodyString.ToLower.Contains(result2) = False Then<br />
e.IsValid = False<br />
e.Message = (&#8220;fail &#8211; - &#8220;) &amp; result2<br />
End If</p>
<p>If e.Response.BodyString.ToLower.Contains(result2) Then<br />
e.IsValid = True<br />
e.Message = (&#8220;pass &#8211; - &#8220;) &amp; result2<br />
End If</p>
<p>Catch ex As Exception<br />
End Try<br />
End Sub</p>
<p>End Class</p>
<p>End Namespace</p>
</address>
<address> </address>
<p><strong>/End Code. </strong></p>
<p>The above script is in Visual Basic.Net and it should work for you and if you need any help in how to install and run it then either <a target="_blank" href="http://www.thetestmanager.com/contact/" title="Email the Test Manager"  target="_blank">send an email</a> or reply in the comments.</p>
<p>One last thing to mention is that the values from the data source are loaded in a fake Parameter Name (<em>Just make one up</em>) which will be ignored by the Website however it will show as a Context Name in the Visual Studio Web Test, so we are really just comparing two Context Names</p>
<p>Good Luck</p>
<p>Martin H</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thetestmanager.com/blog/2010/07/05/verifying-that-the-text-from-a-datasource-exists-in-a-webtest-response-vsts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TaDa Lists (Easy to Use ToDo Lists to make you more productive)</title>
		<link>http://www.thetestmanager.com/blog/2009/07/14/tada-lists-easy-to-use-todo-lists-to-keep-you-more-productive/</link>
		<comments>http://www.thetestmanager.com/blog/2009/07/14/tada-lists-easy-to-use-todo-lists-to-keep-you-more-productive/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 16:25:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.thetestmanager.com/?p=154</guid>
		<description><![CDATA[I&#8217;ve been using TADA lists for about 3 months now and I love them. They just do exactly what you would expect. You set up a list and you can move the priorities around depending on how your plans throughout the day change. I have lists created for In Test In Staging In Planning (soon [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_155" class="wp-caption alignleft" style="width: 310px"><a target="_blank" href="http://www.thetestmanager.com/blog/wp-content/uploads/2009/07/TADA.png" ><img class="size-medium wp-image-155" title="TADA" src="http://www.thetestmanager.com/blog/wp-content/uploads/2009/07/TADA-300x240.png" alt="To Do lists" width="300" height="240" /></a><p class="wp-caption-text">To Do lists</p></div>
<p>I&#8217;ve been using <a target="_blank" href="http://www.thetestmanager.com/blog/goto/http://tadalist.com/" title="Make easy to manage ToDo Lists"  target="_blank">TADA lists</a> for about 3 months now and I love them. They just do exactly what you would expect.</p>
<p>You set up a list and you can move the priorities around depending on how your plans throughout the day change.</p>
<p>I have lists created for</p>
<p>In Test</p>
<p>In Staging</p>
<p>In Planning (soon to be handed to test)</p>
<p>Handed Back to Developement for defect correction.</p>
<p>Let me make clear that this is not meant to replace any defect management system you may have in place. Its far to basic for that.</p>
<p>However if like me your daily priorities are constantly changing and you need to maybe make other team members aware of what things are being worked on in which environments then I have found this as a quick and easy fix.</p>
<p>It can of course be used for many other things like shopping lists. I&#8217;ve taken my mobile phone shopping before and when my wife gets home she jumps on the PC and just updates my TADAlist with any items that she needs that I may have missed off.</p>
<p>I then get an email on my mobile phone and bingo I now have an updated list to walk around the shop with. Yes she could ring me but I&#8217;d have to write it down. I just find this just easier.</p>
<p>Maybe on that note in the future I should make a post about the perils of using technology just because its there.</p>
<p>Anyway enough of the digressing I hope you find the tool as useful as I and the people I work with have.</p>
<p>Martin H</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thetestmanager.com/blog/2009/07/14/tada-lists-easy-to-use-todo-lists-to-keep-you-more-productive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bookmarklets for a Web-Tester</title>
		<link>http://www.thetestmanager.com/blog/2009/02/12/bookmarklets-useful-for-a-web-tester/</link>
		<comments>http://www.thetestmanager.com/blog/2009/02/12/bookmarklets-useful-for-a-web-tester/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 14:00:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.thetestmanager.com/?p=14</guid>
		<description><![CDATA[In this post I want to give people a nice heads up to some of the tools I use in my daily role. These are bookmarklets which is just another word for bookmarks which contain javascript. I use these with firefox although IE and Opera should also fine fine for them also. In Firefox just [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 403px"><img title="Code" src="http://farm3.static.flickr.com/2326/2378867408_4cc90791d6.jpg" alt="Code" width="393" height="295" /><p class="wp-caption-text">Code</p></div>
<p>In this post I want to give people a nice heads up to some of the tools I use in my daily role.</p>
<p>These are bookmarklets which is just another word for bookmarks which contain javascript.</p>
<p>I use these with firefox although IE and Opera should also fine fine for them also. In Firefox just add them to the bookmark toolbar and you&#8217;ll have them at your fingertips.</p>
<p><a href="javascript:(function(){C=document.cookie.split(%22;%20%22);for(d=%22.%22+location.host;d;d=(%22%22+d).substr(1).match(/\..*$/))for(sl=0;sl&lt;2;++sl)for(p=%22/%22+location.pathname;p;p=p.substring(0,p.lastIndexOf('/')))for(i%20in%20C)if(c=C[i]){document.cookie=c+%22;%20domain=%22+d.slice(sl)+%22;%20path=%22+p.slice(1)+%22/%22+%22;%20expires=%22+new%20Date((new%20Date).getTime()-1e11).toGMTString()}})()">Zap Cookies!</a> This will clear out any stored cookies for the current page/site</p>
<p><a href="javascript:void(document.cookie=prompt('Your%20cookie%20is%20currently:\n'+document.cookie,document.cookie));%20void%200">Edit Cookies!</a> This will allow you to edit and stored cookies for the current page/site</p>
<p><a href="javascript:alert('Cookies%20stored%20by%20this%20host%20or%20domain:\n\n'%20+%20document.cookie.replace(/;%20/g,'\n'));">View Cookies!</a> This does exactly what it states, it allows you to view and stored cookies for the current page/site</p>
<p><a href="javascript:document.body.contentEditable%20=%20'true';%20document.designMode='on';%20void%200">Edit Page</a></p>
<p>Allows you to edit any page you use this on. All changes are temporary of course and only visible to you.  (will you ever trust a web page screen shot again?). Not yet sure how this fits into the testing arena, however I though I would include it as someone may make decent use out of it.</p>
<p><a title="Find redirects" href="javascript:(%20function(){%20for%20(i=0;%20i%20&lt;%20document.links.length;%20i++)%20{%20if%20(document.links[i].href.match(/http:\/\/.*http(:|%253A)(\/|%252F)(\/|%252F)/i)){%20alert(document.links[i]);%20}%20}%20})();" target="_self">Find Redirects!</a> This should list any redirects for the current page, however its currently a tiny bit hit and miss and is does not work 100% of the time, it should however suffice for now and I&#8217;ll most likely have to rewrite this at some point in the near future.</p>
<p><a target="_blank" href="http://www.thetestmanager.com/blog/goto/javascript:(function(){var%20k,x,t,i,j,p;%20for(k=0;x=document.links[k];k++){t=x.href.replace(/[%]3A/ig,':').replace(/[%]2f/ig,'/');i=t.lastIndexOf('http');if(i&gt;0){%20t=t.substring(i);%20j=t.indexOf('&amp;');%20if(j&gt;0)t=t.substring(0,j);%20p=/https?\:\/\/[^\s]*[^.,;'%22&gt;\s\)\]]/.exec(unescape(t));%20if(p)%20x.href=p[0];%20}%20else%20if%20(x.onmouseover&amp;&amp;x.onmouseout){x.onmouseover();%20if%20(window.status%20&amp;&amp;%20window.status.indexOf('://" )!=-1)x.href=window.status;%20x.onmouseout();%20}%20x.onmouseover=null;%20x.onmouseout=null;%20}})();">remove redirects </a>Lets see what happens if we now remove those redirects we just found using the above Bookmarklet.</p>
<p><a target="_blank" href="http://www.thetestmanager.com/blog/goto/javascript:(function(){q=document.getSelection();%20if(!q){void(q=prompt('Wikipedia%20keywords:',''))};%20if(q)location.href='http://en.wikipedia.org/w/wiki.phtml?search=" +escape(q)})()">Wikipedia lookup</a> This allows you to select any text on a page and once clicked it will lookup that text on Wikipedia</p>
<p><a target="_blank" href="http://www.thetestmanager.com/blog/goto/javascript:q%20=%20%22%22%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection%20?%20document.getSelection()%20:%20document.selection.createRange().text);%20if%20(!q)%20q%20=%20prompt(%22You%20didn't%20select%20any%20text.%20%20Enter%20a%20search%20phrase:%22,%20%22%22);%20if%20(q!=null)%20location=(%22http://search.yahoo.com/search?p=site:%22%20+%20escape(location.hostname)%20+%20%22%20\%22%22%20+%20escape(q.replace(/\%22/g,%22%22))%20+%20%22\%22%22).replace(/%20/g,%20%22+%22);%20void%200" >Yahoo site search</a> This allows you to select any text on a page and once clicked it will search on Yahoo for more links from that domain with the same text.</p>
<p><a target="_blank" href="http://www.thetestmanager.com/blog/goto/javascript:document.location%20=%20'http://www.alexa.com/data/details/traffic_details?q=" %20+%20document.domain%20+%20'&amp;url='%20+%20document.domain;">Alexa</a> This will carry out a search at Alexa for the domain you were on when you clicked this bookmarklet.</p>
<p><a target="_blank" href="http://www.thetestmanager.com/blog/goto/javascript:document.location%20=%20'http://ha.ckers.org/weird/ipsearch.cgi?" title="msn ip search" %20+%20document.domain" target="_self">MSN IP Search</a> Firstly I should thank Robert Hansen (RSnake) for this one. Once clicked it will carry out an IP search which can help you detect a wider network for your testing.</p>
<p><a href="javascript:(function(){%20function%20selectColor(i)%20{%20return%20[%22#fdc%22,%20%22#cdf%22,%20%22#bfd%22,%20%22#dbf%22,%20%22#fbd%22]%20[i%5];%20}%20var%20u=location.href,%20ul=u.length;%20var%20tparts=[%22%22],%20zparts=[],%20nz=0;%20function%20isDigit(c)%20{%20return%20(%220%22%20&lt;=%20c%20&amp;&amp;%20c%20&lt;=%20%229%22);%20}%20for%20(i=0;%20i&lt;ul;%20)%20{%20for%20(;%20i&lt;ul%20&amp;&amp;%20!isDigit(u.charAt(i));%20++i)%20tparts[nz]%20+=%20u.charAt(i);%20if(i&lt;ul)%20{%20zparts[nz]=%22%22;%20for%20(;%20i&lt;ul%20&amp;&amp;%20isDigit(u.charAt(i));%20++i)%20zparts[nz]%20+=%20u.charAt(i);%20tparts[nz+1]=%22%22;%20++nz;%20}%20}%20if(!nz)%20{%20alert(%22No%20numbers%20in%20URL.%22);%20return;%20}%20D=window.open().document;%20D.write();%20D.close();%20function%20a(n)%20{%20A(D.body,n);%20}%20function%20A(p,n)%20{%20p.appendChild(n);%20}%20function%20E(q)%20{%20return%20D.createElement(q);%20}%20function%20cT(t)%20{%20return%20D.createTextNode(t)%20}%20function%20cBR()%20{%20return%20E(%22br%22);%20}%20function%20cS(t,ci)%20{%20var%20s=E(%22span%22);%20s.style.background=selectColor(ci);%20s.style.fontWeight=%22bold%22;%20A(s,%20cT(t));%20return%20s;%20}%20function%20cTB(v,oc)%20{%20var%20b=E(%22input%22);%20b.size=6;%20b.value=v;%20b.addEventListener(%22input%22,%20oc,%20false);%20return%20b;%20}%20function%20cCB(t,oc)%20{%20var%20L=E(%22label%22),%20b=E(%22input%22);%20b.type=%22checkbox%22;%20b.checked=true;%20b.onchange=oc;%20A(L,b);%20A(L,cT(t));%20return%20L;%20}%20function%20cL(nz,tparts,zparts)%20{%20var%20L=E(%22a%22);%20var%20u=%22%22;%20for%20(var%20i=0;%20i&lt;nz;%20++i)%20{%20A(L,cT(tparts[i]));%20A(L,cS(zparts[i],%20i));%20u%20+=%20tparts[i]+zparts[i];%20}%20A(L,cT(tparts[nz]));%20u%20+=%20tparts[nz];%20L.href=u;%20L.target=%22_blank%22;%20return%20L;%20}%20a(cT(%22Original%20URL:%20%22));%20a(cBR());%20a(cL(nz,%20tparts,%20zparts));%20a(cBR());%20a(cBR());%20var%20fromBoxes=[],%20toBoxes=[],%20padChecks=[];%20for%20(i=0;%20i&lt;nz;%20++i)%20{%20a(cT(%22Run%20%22));%20a(cS(zparts[i],%20i));%20a(cT(%22%20from%20%22));%20a(fromBoxes[i]=cTB(zparts[i],%20listURLs));%20a(cT(%22%20to%20%22));%20a(toBoxes[i]=cTB(zparts[i],%20listURLs));%20a(cT(%22%20(%22));%20a(j=cCB(%22%20Pad%20with%20zeroes%20to%20maintain%20length%22,%20listURLs));%20padChecks[i]=j.childNodes[0];%20a(cT(%22)%22));%20a(cBR());%20}%20a(cBR());%20resultDiv=E(%22div%22);%20a(resultDiv);%20listURLs();%20function%20listURLs()%20{%20while%20(resultDiv.childNodes.length)%20resultDiv.removeChild(resultDiv.childNodes[0]);%20var%20lows=[],%20highs=[];%20for%20(i=0;%20i&lt;nz;%20++i)%20{%20lows[i]=parseInt(fromBoxes[i].value,%2010);%20highs[i]=parseInt(toBoxes[i].value,%2010);%20if(highs[i]-lows[i]%20&gt;%20999)%20{%20A(resultDiv,%20cT(%22Too%20many%22));%20return;%20}%20}%20urls=[];%20function%20cb(sta)%20{%20var%20newzparts=[];%20for%20(var%20i=0;%20i&lt;nz;%20++i)%20{%20var%20z=%22%22+sta[i];%20if(padChecks[i].checked)%20while%20(z.length%20&lt;%20zparts[i].length)%20z=%220%22+z;%20newzparts[i]=z;%20}%20A(resultDiv,%20cL(nz,%20tparts,%20newzparts));%20A(resultDiv,%20cBR());%20}%20fors(nz,%20cb,%20lows,%20highs);%20}%20function%20fors%20(n,%20callback,%20lows,%20highs)%20{%20function%20fors_inner%20(states,%20v)%20{%20if(v%20&gt;=%20n)%20callback(states);%20else%20for%20(states[v]=lows[v];%20states[v]%20&lt;=%20highs[v];%20++(states[v]))%20fors_inner(states,%20v+1);%20}%20fors_inner%20([],%200);%20}%20})()">numbered list</a> One of my favourites this one. It allows you to make a nice numbered list of all parameters on the page which contain numbers.</p>
<p><a href="javascript:(function(){var%20i,f,j,e,div,label,ne;%20for(i=0;f=document.forms[i];++i)for(j=0;e=f[j];++j)if(e.type==%22hidden%22){%20D=document;%20function%20C(t){return%20D.createElement(t);}%20function%20A(a,b){a.appendChild(b);}%20div=C(%22div%22);%20label=C(%22label%22);%20A(div,%20label);%20A(label,%20D.createTextNode(e.name%20+%20%22:%20%22));%20e.parentNode.insertBefore(div,%20e);%20e.parentNode.removeChild(e);%20ne=C(%22input%22);/*for%20ie*/%20ne.type=%22text%22;%20ne.value=e.value;%20A(label,%20ne);%20label.style.MozOpacity=%22.6%22;%20--j;/*for%20moz*/}})()">show hiddens </a>This and Zap Cookies are my most used Bookmarklets. this one will display all hidden fields on a webpage and also allow you to edit them.</p>
<p><a href="javascript:(function(){var%20x,k,f,j;x=document.forms;for(k=0;k&lt;x.length;++k){f=x[k];for(j=0;j&lt;f.length;++j)f[j].removeAttribute(%22maxLength%22);}})()">remove maxlength </a>This will remove all the max lenghts from all input fields (think buffer overflows and code boundary issues)</p>
<p><a href="javascript:(function(){var%20x,k,f,j;x=document.forms;for%20(k=0;k&lt;x.length;++k){f=x[k];for(j=0;j&lt;f.length;++j){f[j].disabled=false;%20f[j].readOnly=false;}}})()">undisable </a>Who says you can&#8217;t click that button <img src='http://www.thetestmanager.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  . This Bookmarklet will enable any disabled objects on the page.</p>
<p><a href="javascript:if%20(location.pathname%20==%20%22/%22);%20else%20if%20(location.pathname.charAt(location.pathname.length-1)%20==%20%22/%22)%20location%20=%20%22..%22;%20else%20location%20=%20%22.%22;%20void%200">up </a>This will take you up one directory level in the site structure</p>
<p><a href="javascript:location.pathname%20=%20%22%22;%20void%200">top </a>This will take you to the top of the domain.</p>
<p><a href="javascript:(function(){%20var%20e,s;%20IB=-1;%20function%20isDigit(c)%20{%20return%20(%220%22%20&lt;=%20c%20&amp;&amp;%20c%20&lt;=%20%229%22)%20}%20L%20=%20location.href;%20LL%20=%20L.length;%20for%20(e=LL-1;%20e&gt;=0;%20--e)%20if%20(isDigit(L.charAt(e)))%20{%20for(s=e-1;%20s&gt;=0;%20--s)%20if%20(!isDigit(L.charAt(s)))%20break;%20break;%20}%20++s;%20if%20(e&lt;0)%20return;%20oldNum%20=%20L.substring(s,e+1);%20newNum%20=%20%22%22%20+%20(parseInt(oldNum,10)%20+%20IB);%20while%20(newNum.length%20&lt;%20oldNum.length)%20newNum%20=%20%220%22%20+%20newNum;%20location.href%20=%20L.substring(0,s)%20+%20newNum%20+%20L.slice(e+1);%20})();">decrement </a>If your URL ends in a number it will reduce it by one every click</p>
<p><a href="javascript:(function(){%20var%20e,s;%20IB=1;%20function%20isDigit(c)%20{%20return%20(%220%22%20&lt;=%20c%20&amp;&amp;%20c%20&lt;=%20%229%22)%20}%20L%20=%20location.href;%20LL%20=%20L.length;%20for%20(e=LL-1;%20e&gt;=0;%20--e)%20if%20(isDigit(L.charAt(e)))%20{%20for(s=e-1;%20s&gt;=0;%20--s)%20if%20(!isDigit(L.charAt(s)))%20break;%20break;%20}%20++s;%20if%20(e&lt;0)%20return;%20oldNum%20=%20L.substring(s,e+1);%20newNum%20=%20%22%22%20+%20(parseInt(oldNum,10)%20+%20IB);%20while%20(newNum.length%20&lt;%20oldNum.length)%20newNum%20=%20%220%22%20+%20newNum;%20location.href%20=%20L.substring(0,s)%20+%20newNum%20+%20L.slice(e+1);%20})();">increment </a>As above but the opposite</p>
<p><a href="javascript:(function(){var%20ims=document.images,%20brokenCount=0,%20brokenURLs=%22%22,%20text,%20i;%20for(i=0;i&lt;ims.length;++i)%20if%20(!%20(ims[i].naturalHeight%20||%20ims[i].fileSize%20&gt;%200))%20{%20++brokenCount;%20brokenURLs%20+=%20%22URL:%20%22%20+%20ims[i].src%20+%20%22\n%22;%20};%20text%20=%20brokenCount%20+%20%22%20broken%20image%22%20+%20(brokenCount==1?%22%22:%22s%22);%20if(brokenCount)%20alert(text%20+%20%22:\n\n%22%20+%20brokenURLs);%20else%20alert(%22No%20broken%20images.%22);%20})()">check images </a>This will check the current page for broken images.</p>
<p><a title="View Variables" href="javascript:(function(){var%20x,d,i,v,st;%20x=open();%20d=x.document;%20d.open();%20function%20hE(s){s=s.replace(/&amp;/g,%22&amp;%22);s=s.replace(/&gt;/g,%22&gt;%22);s=s.replace(/&lt;/g,%22&lt;%22);return%20s;}%20d.write(%22&lt;style&gt;td{vertical-align:top;%20white-space:pre;%20}%20table,td,th%20{%20border:%201px%20solid%20#ccc;%20}%20div.er%20{%20color:red%20}&lt;/style&gt;&lt;table%20border=1&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Variable&lt;/th&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Value%20as%20string&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;%22);%20for%20(i%20in%20window)%20{%20if%20(!(i%20in%20x)%20)%20{%20v=window[i];%20d.write(%22&lt;tr&gt;&lt;td&gt;%22%20+%20hE(i)%20+%20%22&lt;/td&gt;&lt;td&gt;%22%20+%20hE(typeof(window[i]))%20+%20%22&lt;/td&gt;&lt;td&gt;%22);%20if%20(v===null)%20d.write(%22null%22);%20else%20if%20(v===undefined)%20d.write(%22undefined%22);%20else%20try{st=v.toString();%20if%20(st.length)d.write(hE(v.toString()));%20else%20d.write(%22%C2%A0%22)}catch(er){d.write(%22&lt;div%20class=er&gt;%22+hE(er.toString())+%22&lt;/div&gt;%22)};%20d.write(%22&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;%22);%20}%20}%20d.write(%22&lt;/table&gt;%22);%20d.close();%20})();" target="_self">view variables </a>This will list all variable types found on the page. This is more for Developers than testers however its still a useful one to have.</p>
<p><a href="javascript:s=document.getElementsByTagName('SCRIPT');%20d=window.open().document;%20/*140681*/d.open();d.close();%20b=d.body;%20function%20trim(s){return%20s.replace(/^\s*\n/,%20'').replace(/\s*$/,%20'');%20};%20function%20add(h){b.appendChild(h);}%20function%20makeTag(t){return%20d.createElement(t);}%20function%20makeText(tag,text){t=makeTag(tag);t.appendChild(d.createTextNode(text));%20return%20t;}%20add(makeText('style',%20'iframe{width:100%;height:18em;border:1px%20solid;'));%20add(makeText('h3',%20d.title='Scripts%20in%20'%20+%20location.href));%20for(i=0;%20i&lt;s.length;%20++i)%20{%20if%20(s[i].src)%20{%20add(makeText('h4','script%20src=%22'%20+%20s[i].src%20+%20'%22'));%20iframe=makeTag('iframe');%20iframe.src=s[i].src;%20add(iframe);%20}%20else%20{%20add(makeText('h4','Inline%20script'));%20add(makeText('pre',%20trim(s[i].innerHTML)));%20}%20}%20void%200">view scripts </a>Like above however it will list all scripts what can be called on the current page.</p>
<p><a href="javascript:(function(){function%20toArray%20(c){var%20a,%20k;a=new%20Array;for%20(k=0;%20k%20&lt;%20c.length;%20++k)a[k]=c[k];return%20a;}var%20images,%20img,%20altText;images=toArray(document.images);for%20(var%20i=0;%20i%20&lt;%20images.length;%20++i){img=images[i];altText=document.createTextNode(img.alt);img.parentNode.replaceChild(altText,%20img)}})();">zap images </a>This should clear all of the images from the page. Works about 98% of the time. This script may need a little tweaking if I ever get the time.</p>
<p><a href="javascript:(function(){var%20i,c,x,h;%20for(i=0;x=document.links[i];++i)%20{%20h=x.href;%20x.title+=%22%20%22%20+%20x.innerHTML;%20while(c=x.firstChild)x.removeChild(c);%20x.appendChild(document.createTextNode(h));%20}%20})()">full urls as link text </a>Very useful if you want to see where a link is pointing to.</p>
<p>Enjoy</p>
<p>Martin H</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thetestmanager.com/blog/2009/02/12/bookmarklets-useful-for-a-web-tester/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
