tag:blogger.com,1999:blog-50989628543509011442024-03-13T07:33:03.384-07:00Two cents for enterprise QAEnterprise IT experience for free.Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.comBlogger78125tag:blogger.com,1999:blog-5098962854350901144.post-43230404838642161072015-01-23T10:57:00.001-08:002015-01-23T10:58:48.649-08:00Eclipse hangs on start up after proxy configuration change<div dir="ltr" style="text-align: left;" trbidi="on">
The problem appeared after I had changed the proxy settigns of IDE in Preferences/General/Network Connections. After that eclipse started sticking on loading workbench. The following solution solved the problem:<br />
<br />
<ol style="text-align: left;">
<li>Go to your eclipse installation folder</li>
<li>Switch to <b>configuration/.settings</b></li>
<li>Open file <b>org.eclipse.core.net.prefs</b></li>
<li>Set all the boolean properties related to proxy to false</li>
<li>Save the changes</li>
<li>Start Eclipse again</li>
</ol>
<div>
This solution has worked for me. Hope it will work for you as well.</div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-37099811708860973002015-01-23T10:52:00.001-08:002015-01-23T10:52:23.013-08:00Eclipse xpath parser fails to search elements by the tag names<div dir="ltr" style="text-align: left;" trbidi="on">
For those who encountered the same issue (when you try to access the element using xpath by the node name in Eclipse built-in parser) I would recommend either to remove namespace definition from the document at all or remove the default namespace.<br />
Example:<br />
<br />
<apprepo xmlns="asdasd"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><app name="good-app"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><appinfo><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><author name="John Smith"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><stores><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><store name="goo" price="1"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><store name="app" price="1.5"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></stores><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></appinfo><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></app><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><app name="another-good-app"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><appinfo><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><author name="James Smith"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><stores><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><store name="goo" price="2"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></stores><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></appinfo><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></app><br />
</apprepo><br />
<br />
Query: //appinfo returns "no matches"<br />
<br />
Let's now change the namespace so that it is bound to some prefix (let's even not use that prefix in our document)<br />
<br />
<apprepo xmlns:pref="asdasd"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><app name="good-app"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><appinfo><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><author name="John Smith"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><stores><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><store name="goo" price="1"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><store name="app" price="1.5"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></stores><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></appinfo><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></app><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><app name="another-good-app"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><appinfo><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><author name="James Smith"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><stores><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><store name="goo" price="2"/><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></stores><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></appinfo><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></app><br />
</apprepo><br />
<div>
<br /></div>
<div>
Result: query returns all the appinfo nodes found</div>
<div>
<br /></div>
<div>
P.S. - the proper parsing happens even if you completely get rid of the namespace attribute. So Eclipse xpath parser is not working with the documents having the default namespace set.</div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-3615666847100465712014-12-11T05:52:00.000-08:002014-12-11T05:52:37.445-08:00Tip: add element to JScrollPane with not specifying it in constructor<div dir="ltr" style="text-align: left;" trbidi="on">
<i>Tip: If you created <b>JScrollPane</b> object and didn't set the scrollable client as the constructor parameter, you can add it later by invoking <b>setViewportView</b> method of JScrollPane.</i></div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-1783135668890462662014-12-04T08:15:00.000-08:002014-12-04T08:15:40.105-08:00Caption text disappears on JButton if Action is assigned<div dir="ltr" style="text-align: left;" trbidi="on">
While implementing yet another tool helping to automate project processes I faced an issue that took some amount of time to resolve. That might be quite obviouse for those how's been dealing with s<br />
Swing for a long time but I spent a day to find the solution out.<br />
<br />
So I had the code to create JButton with caption like<br />
<br />
JButton jbPerformSomeJob = new JButton("Perform Some Job");<br />
<br />
After I had completed building my UI I ran the app and having no logic assigned to my buttons I got the result I expected to get. I had some UI controls on my JFrame including that my button with the expected caption.<br />
<br />
So after that I added some Action to my button as anonymous class object.<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>jbPerformSomeJob.setAction(new AbstractAction() {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void actionPerformed(ActionEvent e) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>performCustomJob();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<br />
After I started the application again I couldn't see the caption on the button any more.<br />
<br />
So the solution is not obvious enough as to me. It turned out that the name of the action overrides the button caption so to have my caption back I had to define separate named class like:<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>class PerformSomeJobAction extends AbstractAction{<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public GenerateReportAction(String text) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>super(text);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void actionPerformed(ActionEvent e) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>performCustomJob();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
and use the following construction for my JButton<br />
<br />
jbPerformSomeJob.setAction(new PerformSomeJobAction("Perform Some Job"));</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-75809526833378296562014-11-27T15:12:00.002-08:002014-11-27T15:12:51.271-08:00Error executing Proguard in Eclipse<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
Recently faced an issue in Eclipse with ADT plugin while trying to Export Signed Application Package. On the very final step I was getting the error message "Failed to run proguard: Error executing Proguard. Please check Proguard is present at ...". However I knew that proguard is installed. After several minutes of confusion I noticed that there is no slash after the android sdk folder in the path to Proguard. So if you encounter the same issue under the same circumstances you likely did not put slash symbol to the end of the path to your android sdk in Eclipse preferences.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYdwyVBkB5Hk1mFPpjzYSKIWYmyrDFr85wtNo9BW5nJ0ENRCx_Xpra6C5GeLqmopziiReRW6lOHBoLc3_sGrE9ewo1R8OMdK0FTetCNVZr4b8KIaEdvRmqrmVh1afKDacAlmI1h4FmKDE/s1600/2014-11-28-020948_1366x768_scrot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYdwyVBkB5Hk1mFPpjzYSKIWYmyrDFr85wtNo9BW5nJ0ENRCx_Xpra6C5GeLqmopziiReRW6lOHBoLc3_sGrE9ewo1R8OMdK0FTetCNVZr4b8KIaEdvRmqrmVh1afKDacAlmI1h4FmKDE/s1600/2014-11-28-020948_1366x768_scrot.png" height="168" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-79424863216660780172013-09-09T06:33:00.000-07:002013-09-10T12:42:20.549-07:00Apache Felix fails to run in background (including nohup case)<div dir="ltr" style="text-align: left;" trbidi="on">
How to run Apache Felix in background with nohup. Solution is here. In my case I faced the problem when tried to run Squash TM in background. That application is built over <i>Apache Felix</i> and the exceptions told something like:<br />
<br />
<blockquote class="tr_bq">
java.util.zip.ZipException: ZipFile closed<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at java.util.zip.ZipFile.ensureOpenOrZipException(ZipFile.java:642)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at java.util.zip.ZipFile.access$1300(ZipFile.java:56)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:675)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:413)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.WeakZipFileFactory$WeakZipFile$WeakZipInputStream.read(WeakZipFileFactory.java:707)</blockquote>
<br />
or<br />
<br />
<blockquote class="tr_bq">
Spring DM context shutdown thread WARN 06/09 14:35:39 [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Exception<br />
thrown from ApplicationListener handling ContextClosedEvent<br />
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context:<br />
OsgiBundleXmlApplicationContext(bundle=org.squashtest.tm.plugin.testautomation.jenkins, config=osgibundle:/META-INF/spring/*.xml): startup date<br />
[Fri Sep 06 14:35:34 BST 2013]; root of context hierarchy<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:340)</blockquote>
<br />
Certain amount of investigation shown that the common solution in such the case is to exclude the application binding to the console. So do the following:<br />
<br />
<ol style="text-align: left;">
<li>As it's recommended <a href="http://openidm.forgerock.org/doc/integrators-guide/index/chap-services.html">here</a> check if you have ConsoleHandler enabled for your Log4j and disable it using the following entry:<u> java.util.logging.ConsoleHandler.level = OFF </u>(if you're using property file to configure your logging. otherwise use the xml equivalent)</li>
<li>Drop the bundles holding -shell suffix from your Bundles folder. They could look like the following:</li>
<ol>
<li>org.apache.felix.shell.tui-version.jar</li>
<li>org.apache.felix.gogo.shell-version.jar</li>
</ol>
<li>As the alternative of the previous step you may add <span style="background-color: #faf9f5; color: #454d4b; font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 13px;">-Dgosh.args=--nointeractive </span> option to the jvm arguments on calling your app from sh sctipt</li>
<ol>
</ol>
<li>Run your application in the regular way like <i>nohup ./startup.sh &</i></li>
</ol>
<div>
This should help.</div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-25273871683056908682013-08-31T01:43:00.000-07:002013-08-31T01:47:54.659-07:00Yet another hint on "unbound prefix" in your programmatically composed SVG file<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
If you compose your SVG file <em>programmatically</em> you might experience the following issue. Your resulting file won't be parsed with the following exception coming from the parser:</div>
<br />
<blockquote class="tr_bq">
com.larvalabs.svgandroid.SVGParseException: org.apache.harmony.xml.ExpatParser$ParseException: At line 4, column 0: <em>unbound prefix</em></blockquote>
<div style="text-align: justify;">
This exception basically says that somewhere in your SVG markup you use either the tags or the attributes fromt he namespace you didn't specify in SVG header. Examine your resulting SVG code for such the sort of problem. Fixing should help.</div>
<br /></div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-90397001849232615722013-06-14T11:12:00.001-07:002013-06-26T09:20:46.063-07:00SquashTM (Squash TM) 1.5.0 test management system review<div dir="ltr" style="text-align: left;" trbidi="on">
<h2>
Introduction</h2>
<div style="text-align: justify;">
Let's continue exploring test case management systems. This time I chose the one called <a href="http://www.squashtest.org/index.php/en/squash-tm-25664/decouvrir-squash-tm"><i>SquashTM</i></a> (Squash Test Management or <em>Squash TM</em>) - open-source pretty looking and of broad functional scope tool from French team. Unlike some other products <i>SquashTM</i> offers full scope of functions on free-of-charge basis which definitely gives some extra points to the system.</div>
<div style="text-align: justify;">
You also might want to visit my previous review of Zephyr Desktop TCMS. In such the case please follow <a href="http://razgulyaev.blogspot.ru/2013/03/zephyr-desktop-test-case-management.html">this link</a>.</div>
<div style="text-align: justify;">
</div>
<h2 style="text-align: justify;">
Web-site</h2>
<div style="text-align: justify;">
One of the weakest components of the product is the web-site. The face of a product intended to raise the popularity has the big problem with localization. Shame on me, but I really don't speak French and I guess the most part of the world doesn't. Coming to the site of a product pretending to be the world-wide famous one in some observable future I expect to see convenient English version. I believe that will help to develop and to distribute the product much faster than now.</div>
<div style="text-align: justify;">
Well.. Anyway I tried to use google translate and that helped me to manage to download the binary distribution. By the moment the latest available (and stable) version is marked as 1.5.0. The supported operating systems are:</div>
<ul style="text-align: left;">
<li>Windows</li>
<li>Mac OS</li>
<li>Linux</li>
</ul>
<div style="text-align: justify;">
The site has a <a href="https://sites.google.com/a/henix.fr/wiki-squash-tm/">Wiki part</a>. The wiki made me completely confused. Fortunately it is written in English but the table of content has the topics ordered alphabetically. Thus the installation guide can be found somewhere in the middle of the topic list, however the most convenient place I guess is somewhere at the top.</div>
<h2 style="text-align: left;">
Installation</h2>
<div style="text-align: justify;">
<i>SquashTM (or Squash TM)</i> is distributed as jar installer (for Windows OS at least). Despite I chose English version the installation wizard still supplied the dialog controls with the captions like "Suivant" and "Quitter". Fortunately the control icons didn't give me the chance to go the wrong way. Just click the button with big green forward-arrow every time and you will succeed.</div>
<div style="text-align: justify;">
<i>SquashTM</i><i> (or Squash TM) </i>fits people who would like to play with the system before take the positive or negative decision and at the same time wouldn't like to spend much time for setting application up as it comes with default H2 database. So you can use it right after the installer finish working. </div>
<div style="text-align: justify;">
Looks like there is no way to migrate the data from the default database to your custom one (MysSQL is supported). There is direct warning in the Wiki at least saying literally the following</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<i style="-webkit-text-stroke-width: 0px; background-color: white; color: #444444; font-family: Arial, Verdana, sans-serif; font-size: 13px; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 21px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><b>Caution : by switching to a MySQL database, all data previously entered in the on-board database will be lost.<span class="Apple-converted-space"> </span></b></i></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
You can also install the system as Windows service so you don't have to care of starting the application each time your server gets rebooted.</div>
<div style="text-align: justify;">
<i>SquashTM</i><i> (or Squash TM) </i>distribution binds to 8080 port by default so don't forget to change it once you've got a lot of web services running at your server. But please <b>be aware of the official instructions</b> which acn e found on <a href="https://sites.google.com/a/henix.fr/wiki-squash-tm/installation-and-exploitation-guide/3---settings/4-1---change-the-default-port">this page</a> are not correct. In my case I had to change environment variable HTTP_PORT as well to make my instance working on non-default one.</div>
<h2 style="text-align: justify;">
Features</h2>
<div style="text-align: justify;">
<i>SquashTM</i><i> (or Squash TM) </i>offers the standard set of features (see official terms description <a href="https://sites.google.com/a/henix.fr/wiki-squash-tm/user/00-reader-s-guide">here</a>)</div>
<ul style="text-align: left;">
<li>Integrating with SquashTA (the review is coming) </li>
<li>Managing the isolated projects</li>
<li>Managing Requirements (with customizable fields and versioning)</li>
<li>Managing test-cases (with customizable fields)</li>
<li>Managing campaigns (with customizable fields)</li>
<li>Test steps support fields customization</li>
<li>Iterations support field customization</li>
<li>Integration with mantis bug-tracking system</li>
<li>Managing the users and the teams. Each user should be assigned with the predefined permission set called "Profile". See the details <a href="https://sites.google.com/a/henix.fr/wiki-squash-tm/administrator-guide/02---user-administration/clearances-management">here</a>.</li>
<li>Reporting</li>
</ul>
<h2 style="text-align: left;">
Usability</h2>
<h3 style="text-align: left;">
General controls</h3>
<div style="text-align: justify;">
In general the application UI looks quite attractively. The layout consists of three vertical column. The leftmost one and the most narrow at the same time holds workspaces controls. Using it you can switch between requirements, test-cases, campaign and report workspaces. Once you choose one you see two other columns. </div>
<div style="text-align: justify;">
The middle column holds the tree of entities which are currently under management according to workspace selected. You may add, edit or remove entity, arrange them by the folders and perform searching there.</div>
<div style="text-align: justify;">
The leftmost and the biggest column contains the particular entity's details. Another thing I like in the application is that once you edit anything you're provided with rich editor and able to format the text with the broad scope of formatting controls</div>
<h3 style="text-align: justify;">
Requirements and Test-cases</h3>
<div style="text-align: justify;">
The approach of binding requirements and test-cases that is used in <i>SquashTM</i><i> (or Squash TM) </i>doesn't look very comfortable to me. It is supposed that you create set of the requirements and set of the test-cases which are not related to each other originally. Those sets might be of a huge number of items. Then you may do one of the following</div>
<ul style="text-align: left;">
<li>either go through each requirement and bind it (every one) to one ore more test-cases</li>
<li>or go through each test-case and bind it to one ore more requirements</li>
</ul>
<div style="text-align: justify;">
This seems not introducing big problems until you have big project with a lot of requirements and a lot of test cases and very complex requirement hierarchy. </div>
<div style="text-align: justify;">
The much more convenient way would be creating the test-cases straight from the requirement which is not possible in the current version. Thus having the requirement created (not necessarily by the current user - probably by another one) the dedicated tester could cover it with the set of appropriate test-cases and, say, mark it somehow as covered.</div>
<h4 style="text-align: justify;">
Composing test-cases</h4>
<div style="text-align: justify;">
Unlike the requirements the test-cases are not just the free-text but some complex entity. Each test-case has some general information containing:</div>
<ul style="text-align: left;">
<li>Name</li>
<li>Description</li>
<li>Weight: Very High, High, Medium, Low</li>
<li>Nature: Undefined, Functional, Business, User, Non Functional, Performance, Security, ATDD (No idea about what it could mean :) )</li>
<li>Type: Undefined, Compliance, Correction, Evolution, Regression, End-to-End, Partner</li>
<li>Status: Work in progress, Under review, Approved, Obsolete, To be updated (not sure if there is some <a href="http://en.wikipedia.org/wiki/Business_process_management">BPM</a> engine embedded to drive these states automatically)</li>
</ul>
<br />
This is how the general view of the test-case looks like: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXcXlhISb5JkfMVrfEUy-DULvHgHqBFIY1x7lfdzDcOErbfoXo3NjLJpXdwaiOmbNGh2XTBmEyPvQ4dcrov0IG6xyQfjZOgcR3pinuFElo8epcbdnHJtN8ixBEvN1T5s_JJj-BC2Xn3R0/s1600/test-case-general.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="SquashTM test cases" border="0" height="257" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXcXlhISb5JkfMVrfEUy-DULvHgHqBFIY1x7lfdzDcOErbfoXo3NjLJpXdwaiOmbNGh2XTBmEyPvQ4dcrov0IG6xyQfjZOgcR3pinuFElo8epcbdnHJtN8ixBEvN1T5s_JJj-BC2Xn3R0/s640/test-case-general.PNG" title="SquashTM test cases" width="640" /></a></div>
<br />
<div style="text-align: justify;">
All the properties above have nothing to do with the most valuable part of any test-cases - test steps. The steps should be populated at the dedicated "Script" tab. Each step consists of the list of the actions and the expected result. </div>
<div style="text-align: justify;">
You also can assign the particular step to one of the test-case requirements so that it implies that step verifies one. However I couldn't manage to make it work. First strange thing is that when you're managing the requirement set verified by the particular step you're requested to remove unnecessary ones from the entire list of the test-case requirements. IMHO the more obvious way is to mark ones I'd like to include into the step coverage. Anyway.. the second strange thing is that the requirement gets selected if only to click the cell with requirement number (1,2,3...). I would expect the entry is selected wherever I click in the row... The last but the main problem is that despite I choose the requirement and click "Remove from step" button it still remains in the list and not removed.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Here is the step management view:</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyjfx_2ceOMHm4O3DhBrgJ-Pv7g_kQxv_4RlqawTLGDpcHyPLdYRylbsF_JVQf26bpVQWvH2loJOibzpS1Z5JaQY3Vl5VZlECfJS9HqQ0JsCpYnXcSx1KFA72ttxUqS8saGMJ6Alit9A4/s1600/test-case-steps.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="SquashTM test cases" border="0" height="108" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyjfx_2ceOMHm4O3DhBrgJ-Pv7g_kQxv_4RlqawTLGDpcHyPLdYRylbsF_JVQf26bpVQWvH2loJOibzpS1Z5JaQY3Vl5VZlECfJS9HqQ0JsCpYnXcSx1KFA72ttxUqS8saGMJ6Alit9A4/s640/test-case-steps.PNG" title="SquashTM test cases" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In addition you can attach files to the test-case or to the particular step of the script. Here I experienced the problem as well as the application rejected my attempt to attach <b>png</b> file to the test-case as the one of not supported formats.</div>
<div>
</div>
<div>
<h3 style="text-align: left;">
Campaigns</h3>
</div>
<div style="text-align: justify;">
The test-execution mechanism is supported with campaign concept. The manager can create a campaign - the aggregation for the set of test-cases. Each test-case can be assigned to some user. The campaign should be broken down by the iteration - the particular test run. The iteration may contain the subset of the entire campaign test-case set. If the test-case appears in several iterations of a campaign and gets the certain status in one of the iterations then it has the same status in other ones. This should look like this:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOxB3rYc31qYEi8P_8VR_WlBFuBEY5IIrAuiM56qd02AVlju_8csaUDJ5Ejw4Z5D1NrSi0drDQQn9t0duJTtfCH6NKVj8MjCpTrLrWwpneER3j7LPRRvASgyNCQLEJKCw7IDoVcOTCNjM/s1600/campaign.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="SquashTM campaigns" border="0" height="102" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOxB3rYc31qYEi8P_8VR_WlBFuBEY5IIrAuiM56qd02AVlju_8csaUDJ5Ejw4Z5D1NrSi0drDQQn9t0duJTtfCH6NKVj8MjCpTrLrWwpneER3j7LPRRvASgyNCQLEJKCw7IDoVcOTCNjM/s640/campaign.PNG" title="SquashTM campaigns" width="640" /></a></div>
<br /></div>
<div style="text-align: justify;">
Once the tester which is assigned with the tests sees the iteration ready in their campaign workspace they may start it like it is shown on the screen-shot:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTIlXXXICnLFEC7Bu7FAgwi1ujFhtAG2F2-6jYZhzhIvkgKdPWl9KB8WDm5H-wXNPUh5Eky0iR0mQG8T9Doe-2tLNCoVuQznggJqr-J3pZtPgLaBrOHhX5G2l8L9K90jriOoEoB7dK13Y/s1600/campaign-start.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="SquashTM test execution" border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTIlXXXICnLFEC7Bu7FAgwi1ujFhtAG2F2-6jYZhzhIvkgKdPWl9KB8WDm5H-wXNPUh5Eky0iR0mQG8T9Doe-2tLNCoVuQznggJqr-J3pZtPgLaBrOHhX5G2l8L9K90jriOoEoB7dK13Y/s640/campaign-start.PNG" title="SquashTM test execution" width="640" /></a></div>
<div>
<br /></div>
<div style="text-align: justify;">
Clicking "Begin" button takes the user to the steps of the test-case until the steps are over. Once they are the user moves to the next test-case of the iteration automatically until there are no more test-cases in the scope. </div>
<div>
<h3 style="text-align: left;">
Reporting</h3>
<div style="text-align: justify;">
Reporting capabilities of the application leaves ambiguous impression. Officially the tool has quite functional reporting. You may generate the report to analyze your requirements and test cases regardless whether you performed any test execution or not. Each report you may export to PDF format to present the results to your management for example.</div>
<div style="text-align: justify;">
Its also possible to generate the report for certain executions (aka campaigns). That's all great however I met the problems again. When I tried to filter the report data by my test project only, the filter couldn't ender the project set in the filter dialog so I had to be content with the all the existing projects in my report.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Here are several examples of the reports I managed to generate:</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX_Ay6CEp1RYBjsqQqnqE9rhsV6i_1Jv7MFPrwXRdtkaEsk8Q0W5yxMGhiL_7Nt8ZQ9e7HvhmvIObjFXAs1x8pEf8nEJqTpJyoKr_YnK9pJC_yBJUvIbDaUc3Rob9qPKiThE-Hkl9vDsk/s1600/campaign-report.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="SquashTM test reports" border="0" height="130" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX_Ay6CEp1RYBjsqQqnqE9rhsV6i_1Jv7MFPrwXRdtkaEsk8Q0W5yxMGhiL_7Nt8ZQ9e7HvhmvIObjFXAs1x8pEf8nEJqTpJyoKr_YnK9pJC_yBJUvIbDaUc3Rob9qPKiThE-Hkl9vDsk/s640/campaign-report.PNG" title="SquashTM test reports" width="640" /></a></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7T5w2eZAFEYFzAp7X9hT7tQQpN4hndDHQhbUXwYKVYsjmusk4VBnZrLB467gFzDdT4T7SS4U0aBumjvECrgrHoN0VRoPDa18BqqLStcdvlF3lmJRfb0nRFt09p6hSx2VEF19ihe8j138/s1600/requirement-coverage-by-test-execution-phase.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="SquashTM test reports" border="0" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7T5w2eZAFEYFzAp7X9hT7tQQpN4hndDHQhbUXwYKVYsjmusk4VBnZrLB467gFzDdT4T7SS4U0aBumjvECrgrHoN0VRoPDa18BqqLStcdvlF3lmJRfb0nRFt09p6hSx2VEF19ihe8j138/s640/requirement-coverage-by-test-execution-phase.PNG" title="SquashTM test reports" width="640" /></a></div>
<div style="text-align: justify;">
</div>
</div>
<div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7XZFONi6SbADTllbYFhb3MrC2VTHXSfNarDDQhnBOhVVV9oefTKhlq1Rx7cSnIwjAflRJnvauUmrGsc43vkvOUVBYdr2ulgGek3G83D_GEbq49vWpzB6uvucLN4ONU-268OfqfPq49jc/s1600/qualitative+coverage+by+tests.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="SquashTM test reports" border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7XZFONi6SbADTllbYFhb3MrC2VTHXSfNarDDQhnBOhVVV9oefTKhlq1Rx7cSnIwjAflRJnvauUmrGsc43vkvOUVBYdr2ulgGek3G83D_GEbq49vWpzB6uvucLN4ONU-268OfqfPq49jc/s640/qualitative+coverage+by+tests.PNG" title="SquashTM test reports" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<h2 style="text-align: left;">
Conclusion</h2>
<div style="text-align: justify;">
I'm confused and it is quite hard to give the resolution on the tool. From the one hand from functional and usability standpoints it is the best free test-case management systems I worked with. From another hand it is still quite raw and buggy. Here are some problems I found which I couldn't assign to the topics above and which are mostly related to the user management functionality:</div>
<ul>
<li>Whatever profile I assigned to a user I always saw Advanced Tester one when I came back to the corresponding dialog. However when I log in as that user I see the actually assigned profile for them</li>
<li>When I compose the team I see the users I recently deleted and able to get to their details by drilling from the team configuration dialog</li>
<li>Annoying problem is that the trees in the workspaces are not always updated in time when you add some sub-entities there</li>
</ul>
<div style="text-align: justify;">
Well. I think despite there are a lot of quite annoying problems in the product they are all eliminated with the fact this tool is freeware and provides good functional scope and nice usability. Yet it fits small and middle-size development teams but the suject has all the chances to become domain standard in the observable future. So I give this TCMS <b>8.5</b> points of totally <b>10.</b> I would give more, but those annoying bugs...</div>
</div>
<div>
<br /></div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-70846397903156852882013-05-14T04:30:00.001-07:002019-10-22T07:54:23.185-07:00Creating awesome and simple interactive checklist in MS Excel in three steps<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
What we need from our checklist</h2>
<div style="text-align: justify;">
Looking through some solutions describing the check-list creation I realized that a lot of the cases require from me being aware of VBA or some components paradigm for inserting the check-boxes into the cells and make them impact the check-list items in such or another way. That frustrated me so I'm presenting some alternative solution here which will not take a lot of time to create your own and awesome-looking checklist. So what the people usually need from the check-list:</div>
<div style="text-align: justify;">
<ul>
<li>Mandatory</li>
<ul>
<li>Check-boxes which are easy to fit into the cell</li>
<li>Check-boxes which can visually take two states: checked and un-checked</li>
</ul>
<li>Nice-to-have</li>
<ul>
<li>Check-box states affect the look-n-feel of some other parts of the check-list</li>
<li>Scalable structure so we're capable to add the items with no need to configure new rows</li>
</ul>
</ul>
<b>P.S.</b> - Looking for a cool checklist but you do not have MS Excel installed? <a href="https://webelement.click/en/interactive_checklist_libreoffice">Check how you can implement cool checklist in LibreOffice/OpenOffice Calc</a>.<br />
<h3>
What we're going to do</h3>
<div>
The checklist we're doing will consist of the simple table structure where one of the fields is intended to hold the check-box. Changing that check-box'es state causes the entire row shading or unshading (depending on whether it is checked or not)</div>
<div>
The check-box will not require any scripting so you do not need to know VBA.</div>
</div>
<h2 style="text-align: left;">
Nice.. Implementing skeleton</h2>
<div style="text-align: justify;">
The first and the simplest thing we need to do is to design the fields which our steps in the check-list will consist of. For the presentation lets limit the field set with five ones, where the last field will be holding the check-box. That should look like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWBUTDIZ9Q3yiuMtcnp1d0AUpyAJrk2mchWempyRCF03OKvqq-AM9nYqpqaviHqZQq_W6qXlA_Io4Ci-Cp_J0dznK9u9c2W0r6i9KSlN8_Neyn7j7VxdXH7vO5h-4e0UEAd7Us3D-sBSM/s1600/1-structure.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="spreadsheet skeleton without check-boxes yet" border="0" height="174" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWBUTDIZ9Q3yiuMtcnp1d0AUpyAJrk2mchWempyRCF03OKvqq-AM9nYqpqaviHqZQq_W6qXlA_Io4Ci-Cp_J0dznK9u9c2W0r6i9KSlN8_Neyn7j7VxdXH7vO5h-4e0UEAd7Us3D-sBSM/s640/1-structure.PNG" title="spreadsheet skeleton without check-boxes yet" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<h2 style="text-align: left;">
Good. Implementing check-boxes</h2>
<div style="text-align: justify;">
We need some content to make the example more vivid, right? And of-cause we need what we're reading this post for - the check-boxes. So let's do that. Say, we're going to get into the room and we know how to do that in the most effective way. Thus, we'd like to describe the step sequence not to confuse the order when we'd like to do that again. See the example of what we got.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX4FsShTBqd3yNAJXx8K_8eRI0hXEpIEg4Tph_HEuNYxPRHcJFWooDg_HRYk8VJGXGBOMqQnUXP8h2Q-GDnkB3VONY8Ub6PgjUpaDQrNuXPzacbTqIdvRSfDKKHTs__RceeOzIRn1qUm4/s1600/2-creating_check-boxes_result.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="excel checklist with check-boxes" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX4FsShTBqd3yNAJXx8K_8eRI0hXEpIEg4Tph_HEuNYxPRHcJFWooDg_HRYk8VJGXGBOMqQnUXP8h2Q-GDnkB3VONY8Ub6PgjUpaDQrNuXPzacbTqIdvRSfDKKHTs__RceeOzIRn1qUm4/s1600/2-creating_check-boxes_result.PNG" title="excel checklist with check-boxes" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
Okay, so.. Howe we managed to do this? The heading row is just colored with blue - not a rocket science. Lets make the check-boxes. To make the check-boxes select the column area under "IsDone" header. Right-click it and choose "Format cells" menu item. Configure the font like it's shown on the screen-shot:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOb5S7cYawBCu6pDwEYGo4qI5PLbWMSR8xH8U6cSC6oQgXQsgK_yZBjdDv8QkhjLeR28cTS50n2SxE8OoL-ddOcVPCRaOvf40siBow438MBnuzhipW0ZTwM9n-TsYFpoghyif6h0PBn6k/s1600/2-creating_check-boxes_font.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Inserting checkboxes into excel checklist" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOb5S7cYawBCu6pDwEYGo4qI5PLbWMSR8xH8U6cSC6oQgXQsgK_yZBjdDv8QkhjLeR28cTS50n2SxE8OoL-ddOcVPCRaOvf40siBow438MBnuzhipW0ZTwM9n-TsYFpoghyif6h0PBn6k/s1600/2-creating_check-boxes_font.png" title="Inserting checkboxes into excel checklist" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
Align the text in the cells so that the check-boxes are in the center of the cell. That is it. Now when you set the focus to the check-box cell and press "x" key the check-box gets checked. If you press "o" key the check-box gets unchecked. Simple and visually acceptable solution, isn't it?</div>
<h2 style="text-align: left;">
Awesome! Implementing items highlighting</h2>
<div style="text-align: justify;">
Let's now add some flavor to our checklist. I'd like my checklist shade the row when I set the check-box checked. I'm going to reach this goal using the conditional formatting. Let's follow the steps (the steps are applicable to the example. you should slightly reconsider the formula according to your check-box relational position in your checklist):</div>
<div style="text-align: justify;">
<ol>
<li>On the home tab click "Conditional Formatting" and choose "Manage rules" menu item</li>
<li>Click "New rule..."</li>
<li>In "Edit Formatting Rule" dialog select "Use a formula to determine which cells to format"</li>
<li>In "Format values where this formula is true" type <b style="font-style: italic;">=($E2="x") </b>as in the example the first check-box resides in the cell E2</li>
<li>Click "Format..." button. Switch to "Fill" tab</li>
<li>Choose the color you'd like to shadow your checked rows. Click OK</li>
<li>Click OK on "Edit Formatting Rule" dialog</li>
<li>You should see your new rule added. Now we should specify the area that rule covers (see the screen-shot for the example). </li>
</ol>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg45ezFjiJk5wcKL_f6Lro9rpbSMwxMhdQg4J3BJYWNWUQ9q_Z3Hwne1ljANj0hkvDzahhebZx6V-NmGuN_EIj82LHrtM8HLFNZVpusH8rQ4e62aE8HkuhJrssUTM6ycUsWZ4n67yzc9ZI/s1600/3-final_configuration.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="shadow the checked rows in excel checklist" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg45ezFjiJk5wcKL_f6Lro9rpbSMwxMhdQg4J3BJYWNWUQ9q_Z3Hwne1ljANj0hkvDzahhebZx6V-NmGuN_EIj82LHrtM8HLFNZVpusH8rQ4e62aE8HkuhJrssUTM6ycUsWZ4n67yzc9ZI/s1600/3-final_configuration.PNG" title="shadow the checked rows in excel checklist" /></a></div>
<div>
<br /></div>
<div>
Now we have the awesome check-list. You might want to have the row (aka steps) grouping in your checklist. Visit <a href="http://razgulyaev.blogspot.ru/2012/05/how-to-group-rows-in-ms-excel-so-that.html">this tutorial</a> to get aware of how to implement row grouping.</div>
<div>
<br /></div>
<div>
Aaaand finally... you should get something like this:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQ93KcXSvFtANB0i-6Xrw98tRkCU_vdj3hFqbmDr7J4anPlWIJAZlP6VvGgH0k4FS-Up7fHJZYWXOLfJDOnR4TBFZv8sq9yqVLpaOIuykiT5okAD_He2VJ-IIvQy9qp8-gWQayatlruI/s1600/result.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="awesome checlist in excel in three steps" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQ93KcXSvFtANB0i-6Xrw98tRkCU_vdj3hFqbmDr7J4anPlWIJAZlP6VvGgH0k4FS-Up7fHJZYWXOLfJDOnR4TBFZv8sq9yqVLpaOIuykiT5okAD_He2VJ-IIvQy9qp8-gWQayatlruI/s1600/result.PNG" title="awesome checlist in excel in three steps" /></a></div>
<div>
<br /></div>
</div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-19755142371451382492013-03-05T03:03:00.002-08:002013-06-14T12:51:55.452-07:00Zephyr Desktop test management system review<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
Introduction</h2>
<div style="text-align: justify;">
This post originates the series of reviews of test-case management systems. All the tools are available for free (some with restricted functionality). The first one is Zephyr Desktop. This tool asserts supporting set of common TCMS use-cases such as manage requirements, test-cases and executions. It also features some stuff that allows to integrate your TCMS system with test-case automation solution.<br />
See also SquashTM test case management system <a href="http://razgulyaev.blogspot.ru/2013/06/squashtm-150-test-management-system.html">review</a>.</div>
<h2 style="text-align: left;">
Web-site</h2>
<div>
<div style="text-align: justify;">
Nice web-site. It is easy to navigate and to find required distribution. However it does not differ much from the competitors. Free version is available after few of registration steps <a href="http://www.getzephyr.com/buy/index.php">here</a>.</div>
</div>
<h2 style="text-align: left;">
Installation</h2>
<div style="text-align: justify;">
Zephyr Desktop Community Edition is supplied with built-in MySQL server and Apache Tomcat 5.5 servlet container. The installation process is straightforward and should not make a problem for anyone. After you've installed the system you get two new services running: Zephyr server and MySQL server with operational database. Of course you have to ensure all the ports you're going to use are not already used by some other processes.</div>
<h2 style="text-align: left;">
Features</h2>
<div style="text-align: justify;">
The free version I've tried offers a set of common-qa-practice use cases. However it limits the number of available project by one. This is not so bad as you're free to work-around such the problem by considering the release term as product-release term (later I'm explaining what all this stuff means). So, the application allows to:</div>
<div style="text-align: justify;">
<ul>
<li>Manage the resources (add, remove or edit users)</li>
<li>Specify requirements, structure them and map to the test-cases</li>
<li>Break-down test-cases by purpose (like regression, user acceptance, etc)</li>
<li>Schedule TC execution</li>
<li>Analyze project statistics</li>
<li>Integrate with bug-tracking system (not touched)</li>
<li>Execute external processes (not touched)</li>
<li>Interact with external tools via API (not touched)</li>
</ul>
</div>
<h2 style="text-align: left;">
Usability</h2>
<div style="text-align: justify;">
So, what's the user flow as it is seen for me: Some test manager logs in and configure the project. They scope available resources and releases and probably fills the project with release-specific requirements. The tester covers the requirements with test-cases. They break-down the test-cases by their purpose. The test manager schedules the test execution for particular test-set type (e.g. regression testing). Tester passes the test cases. They set the status for each one so that once the execution done we have the set distinguished by PASSED/FAILED so we have the statistics to be analyzed.</div>
<h3 style="text-align: left;">
Look&Feel</h3>
<div style="text-align: justify;">
<h4>
Graphical framework</h4>
UI looks a bit heavy and is built on Flex technology. It implements dialog model. It works fast but sometimes it looks overdriven so you can get lost in the numerous dialogs like this</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWBRpT4LhlXXi2KM0HCD5IGJu5VefzEsStAueu8nqjb_FWLxWx_MvSuc6MSA07F77fYXbPvlLKxL5kXh8_JYM_Wl0f8fTQeMf2InPRW9ct6wUMvGwrk758emLAIUGQedb_ZkJl3yC6cgY/s1600/windows.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="zephyr desktop community edition ui layout" border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWBRpT4LhlXXi2KM0HCD5IGJu5VefzEsStAueu8nqjb_FWLxWx_MvSuc6MSA07F77fYXbPvlLKxL5kXh8_JYM_Wl0f8fTQeMf2InPRW9ct6wUMvGwrk758emLAIUGQedb_ZkJl3yC6cgY/s640/windows.PNG" title="" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
That is a good solution for desktop applications as we have a sort of task-bar in windows or linux-GUI along with capability of switching between the windows using short-cuts (aka hot-keys). However the same approach in Web UI doesn't look so organic.<br />
The frameworks allows drag'n'drop items at some places. It is generally used in tree structures to move items from one folder to another. However it does not allow to move folders to subfolders. However such the feature would look quite useful for me.</div>
<div style="text-align: justify;">
<h4>
Releases</h4>
As I said before we're not able to manage several projects in free version of Zephyr Desktop. However the tool offers the release management feature which separate the workspace into several isolated areas. This looks like the picture below:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTdhHLkTq4UgmPBfqVTH_q6hIPZZ0AMo6CPGdT6Jb25CYkAl2ZhlzDUVCWsq8XK3lZrlL0vGVARvR-9kOVR8QBA8OV6vn5T6qYhTKmSvGGOCacuc1ML6_yUJwKFZXGsJPJNXe0Q7hnPNk/s1600/releases+tabs.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="zephyr desktop community edition release tabs" border="0" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTdhHLkTq4UgmPBfqVTH_q6hIPZZ0AMo6CPGdT6Jb25CYkAl2ZhlzDUVCWsq8XK3lZrlL0vGVARvR-9kOVR8QBA8OV6vn5T6qYhTKmSvGGOCacuc1ML6_yUJwKFZXGsJPJNXe0Q7hnPNk/s640/releases+tabs.PNG" title="" width="640" /></a></div>
<div style="text-align: justify;">
Once you select particular release tab you're able to manage requirements, test cases and other stuff in isolation from other releases. Thus, you can establish the convention saying that release is not actually just a release but PRODUCT-RELEASE. Hence you may manage several projects in one.<br />
<h4>
Requirements</h4>
The tool allows managing the requirements. This is great as (isn't is strange?) not all the TCMSs have requirements as the basic entity in the structure. However the this area has a bit of drawbacks as well. Say, why not to allow the user creating test-cases straight from the requirement? Does that look okay when you have hundreds of requirements and then should create thousands of test-cases and only after all finally bind them to each other? Anyway this way is how all happens in Zephyr.<br />
<h4>
Test-case management</h4>
<div>
All the test-cases may exist either being bound to certain requirement or separately. Application offers useful feature called "Repository". The repository allows breaking the test-cases down by the purpose you'd like them to target. You may want to include the test-case in, say, user acceptance set along with regression set. This is what repository will help you to achieve. However I couldn't manage to map the test-case to several repos at once, so I had to clone them to move separated items each to their dedicated repository folder.</div>
<div>
Test cases consist of the steps. Each step can be described in comprehensive way including attaching documents as files or specifying URLs for those resources. You also can keep the release-wide documents uploaded so they are visible from everywhere.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwCn7hEy3GYeJ6xVmAbzbJ5-vW6ZPssg7EjMijzfZcSonIQq4GX0LnlGzniP-PsATil8FNIPHbQp1ICJkWAesFb46R57mESB-4yxBuz4yui_hXe50jt64kln27DG1FwfFyp_P8yhAUmps/s1600/Test+case.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="zephyr desktop community edition managing test-cases" border="0" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwCn7hEy3GYeJ6xVmAbzbJ5-vW6ZPssg7EjMijzfZcSonIQq4GX0LnlGzniP-PsATil8FNIPHbQp1ICJkWAesFb46R57mESB-4yxBuz4yui_hXe50jt64kln27DG1FwfFyp_P8yhAUmps/s640/Test+case.PNG" title="" width="640" /></a></div>
<div>
<br /></div>
<div>
Another feature that I like is test-case change-history so you can track what changes have been made to the test-case since its creation.</div>
<div>
Test cases (as actually most of the entities in the system) are stored in a sort of folder structure so you're free to order your stuff in the way you like. However I would expect I see (or have the option to see) all the items in selected folder and its sub-folders. Now if you want to observe all the tests you have to bypass all the tree-folders manually.</div>
<h4>
Scheduling</h4>
<div>
This function seems to be the only one I couldn't cavil at. It allows scheduling the execution of your tests breaking it down by phases and sub-phases with responsible resources and timing boundary. It should look like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFfGNHzWVznBSUyLM_HeQjClbeF_MwRWYPiF0KA4eSSTOCom3s5lfp5QpXOmSi5ax-7UPK0oNF8gB6ARqwVPZuHRnheswyTO2hDWjRihJJceCUif5zcin-go_IAw5xaQgdXDDQv2LY1FA/s1600/phases-subphases.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="zephyr desktop community edition scheduling test execution" border="0" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFfGNHzWVznBSUyLM_HeQjClbeF_MwRWYPiF0KA4eSSTOCom3s5lfp5QpXOmSi5ax-7UPK0oNF8gB6ARqwVPZuHRnheswyTO2hDWjRihJJceCUif5zcin-go_IAw5xaQgdXDDQv2LY1FA/s640/phases-subphases.PNG" title="" width="640" /></a></div>
<div>
<br /></div>
<h4>
Reporting</h4>
<div>
After you (or your guys) have executed all the tests you've been scheduled for, you may check the statistics of your project. In free version it looks quite poor. It delivers some simple stat of what part of your tests failed and what didn't, which part of requirements is covered with the test-cases, etc. It represents as the release-specific statistics as the project-wide one. All that looks like this:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXsleF9bEEwndpkWHeJHhEs_XsmiN-QCye59DivoW4R7GVfwjVkp6tfDFloRpJ_qf_xyaNDS1pjFRGEs1Y-8vXHwJ0Caeqxx0cppsfJFCB2jHCBnnhyphenhyphenPagPynISP1DvBj_308bXfQikqk/s1600/MR-Reqs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="zephyr desktop community edition statistics" border="0" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXsleF9bEEwndpkWHeJHhEs_XsmiN-QCye59DivoW4R7GVfwjVkp6tfDFloRpJ_qf_xyaNDS1pjFRGEs1Y-8vXHwJ0Caeqxx0cppsfJFCB2jHCBnnhyphenhyphenPagPynISP1DvBj_308bXfQikqk/s640/MR-Reqs.png" title="" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv7JOnwY9FmdjGkG1JjGfzOE8Ur65oxfKgGhsKkw_tYgeTNQ0X2Hdy-PmcwHfgdJrX1qs30XPynuVUGy0Qmj5Cf65znQ5a-26kzJBrLsYOXwO10zN7JC9p0CjeuR5fd9rcWOxJDfjWkYw/s1600/MR-TCExec.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="zephyr desktop community edition statistics" border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv7JOnwY9FmdjGkG1JjGfzOE8Ur65oxfKgGhsKkw_tYgeTNQ0X2Hdy-PmcwHfgdJrX1qs30XPynuVUGy0Qmj5Cf65znQ5a-26kzJBrLsYOXwO10zN7JC9p0CjeuR5fd9rcWOxJDfjWkYw/s640/MR-TCExec.png" title="" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXR_MCA3EVh1snpEc3dEhvM6aMeRCtmD0ppi6BVELZXA2Pa_AAxlXeyH5f8uc6OF2SESStXW26IdkNUM4ZmBEfGzsj5L9F9H3jChW4LJ_AIEfJpfmVzMjWsfLlAH6AbuS6Z24D-NgBOVk/s1600/MR-detailed-stat.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="zephyr desktop community edition statistics" border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXR_MCA3EVh1snpEc3dEhvM6aMeRCtmD0ppi6BVELZXA2Pa_AAxlXeyH5f8uc6OF2SESStXW26IdkNUM4ZmBEfGzsj5L9F9H3jChW4LJ_AIEfJpfmVzMjWsfLlAH6AbuS6Z24D-NgBOVk/s640/MR-detailed-stat.PNG" title="" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
You may also observe the main dashboard but this has not a lot of sense in free version where you're not able to manage several projects.</div>
<h4>
Not covered features</h4>
<div>
As I mentioned before I had no chance to play with a few of features in Zephyr. However when I tried to integrate the tool with JIRA it warned me of I will not be able to change my choice in the future and this decision should be final. Doesnt look pretty flexible for me :)</div>
</div>
<h2 style="text-align: left;">
Conclusion</h2>
<div style="text-align: justify;">
Anyway despite a set of drawbacks found in the tool I find this TCMs pretty fitting the needs of the ordinary QA team of 5-10 persons which manages not very large test sets (say 300-400 test-cases against 50-100 requirements) and which does not plan to change bug-tracking system :)</div>
<div style="text-align: justify;">
This tool will also be found comfortable for the teams which do not spend time for deployment and configuring huge and complex systems and want to start managing the tests as soon as possible.</div>
<div style="text-align: justify;">
I give this TCMSs <b><u>7.0</u></b> points of totally <b><u>10.0</u></b>.</div>
<div>
<br /></div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-5467975792909495082013-02-11T01:38:00.002-08:002013-02-11T05:07:00.501-08:00Another hint on how to read files with corrupted or unknown encoding<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
If you need to read a file the encoding of which you have no idea about, I recommend to use FireFox browser. Originally I faced a problem when tried to read sqlplus.exe output. Opening saved redirection with FireFox browser solved the problem.<br />
So:<br />
<ol>
<li>Save your text to some file</li>
<li>In command line type "firefox YOUR_FILE_NAME" or specify the path in browser's address bar using <u>file://</u> URI </li>
</ol>
Bowser automaticall detects the proper encoding and converts the text so that you can read it. <br />
<ol>
</ol>
</div>
<div style="text-align: justify;">
Such the approach does not require some special software installation like text-encoding converters etc.</div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com1tag:blogger.com,1999:blog-5098962854350901144.post-10918988365606900182013-01-07T03:41:00.000-08:002013-07-08T07:15:59.839-07:00Reading multiple files with servlets. HTML 5.<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<h2>
Intro</h2>
In this example we check how to process the form having one input of file type where a user chooses several files at once. We use Servlet specification of version 3.0 which is implemented in Tomcat server 7. First of all I'd recommend to get familiar with <a href="http://razgulyaev.blogspot.com/2012/11/how-to-prepare-yout-eclipse-ide-for-web.html">this</a> post to perform proper configuration of your Java application and development environment. Then.. Let's start.</div>
<div style="text-align: justify;">
The example (tutorial) application will use simple html page (JSP is not used in this example). That page has one form allowing to choose several files through one dialog and then post button to submit the data. Under the form there will be a frame where the form will return the result to.</div>
<div style="text-align: justify;">
Not to make the example too complex lets say our application will be printing the content of each file to that frame with the corresponding filenames. Once you understand how it works you may process the files in any other way rather than printing their content. </div>
<div style="text-align: justify;">
So we need to pass through several steps to accomplish the goal. They are:<br />
<br />
<ol>
<li>Create html form</li>
<li>Create servlet</li>
<li>Process the data (read multiple files with servlet)</li>
</ol>
<h2>
HTML Form</h2>
<div>
Form is the facility to post your data from your client to the server. Either you're using CGI approach or servlet like in this example you have to consider two things:</div>
<div>
<ul>
<li>which data and in which format you're going to send</li>
<li>which URL the server should interpret as your data handler</li>
</ul>
<div>
The simple page body we'll be using looks like this<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXKf1EMZByVvEUNWBx9RN9q5WvA8gZQCi7eB7SmDM5NjdohCzBnZPB-UJZMBZsT_2W0tlgCyQNNjIU15vVavwJPB12Jo4bZaJH0YGWKuCWnnwXaCrQotFpv92MuoNm0yfBBVZBnL7i6mE/s1600/Servlet-step-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="HTML form - Upload files with servlet example" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXKf1EMZByVvEUNWBx9RN9q5WvA8gZQCi7eB7SmDM5NjdohCzBnZPB-UJZMBZsT_2W0tlgCyQNNjIU15vVavwJPB12Jo4bZaJH0YGWKuCWnnwXaCrQotFpv92MuoNm0yfBBVZBnL7i6mE/s1600/Servlet-step-1.png" title="HTML form - Upload files with servlet example" /></a></div>
<br /></div>
</div>
<div>
</div>
<div>
<br />
<pre class="brush: xml"><body>
<form id="example-form"
action="HandlerServlet"
method="post"
enctype="multipart/form-data"
target="resultFrame">
<input type="file" name="example-input" multiple />
<input type="submit"/>
</form>
<br />
<iframe name="resultFrame" frameborder="1" width="100%" height="400" scrolling="yes" />
</body>
</pre>
<br />
<div style="text-align: left;">
<br /></div>
<br />
There are some important things in lines: 3,5,6 and 7.<br />
<br />
<ul>
<li>HandlerServlet is actually relative URL to be considered by the server as handler of the data that is coming from your form</li>
<li>enctype is the attribute which should be set to "multipart/form-data" if you're going send file content. Otherwise you'll be sending the only file names</li>
<li>target attribute specifies the frame the server response will be printed out to (you should have the frame with corresponding name on your page like we do)</li>
<li>multiple is the attribute wich should be specified if you'd like to choose several files simultaneously (not working in IE pre 10)</li>
</ul>
<div>
Now you're ready to write some server code.</div>
<div>
<br /></div>
<h2>
Creating servlet</h2>
<div>
Writing a servlet is not a rocket science. You simply need to create new class, extend it from <b>javax.servlet.http.HttpServlet</b> and override some methods. We're going to override the only one - "<b>protected void doPost(..)</b>" which actually takes the client request wrapped with "<b>HttpServletRequest req</b>". Latter contains all the data we need to reach our goal (retrieve the content of the files sent from the client). So the skeleton will look like this:</div>
<div>
<br /></div>
<pre class="brush: java">@MultipartConfig
public class HandlerServlet extends HttpServlet{
/**
*
*/
private static final long serialVersionUID = -717277851360696409L;
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
}
}
</pre>
<div>
<b><i>NB!</i></b> Notice that the annotation (line: 1) is pretty much important. Having no such one specified you would not be able to parse your request into the parts.</div>
<div>
Register your servlet in web.xml file so that the server knows which URL is associated with it. Use this example:</div>
<div>
<br /></div>
<div>
<div style="text-align: left;">
<pre class="brush: xml"> <servlet>
<description></description>
<display-name>HandlerServlet</display-name>
<servlet-name>HandlerServlet</servlet-name>
<servlet-class>your.package.HandlerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HandlerServlet</servlet-name>
<url-pattern>/HandlerServlet</url-pattern>
</servlet-mapping>
</pre>
<br /></div>
<div>
, where <b>your.package</b> is the package you place your servlet to.</div>
<div>
<br /></div>
<div>
Lets now distract from the java code and check what the client actually sends. To know that we need to use some traffic sniffer. I use Fiddler. So, I prepared two files and going to send them to the server (no matter we have no one yet).</div>
<div>
If you configured your project right (as described <a href="http://razgulyaev.blogspot.com/2012/11/how-to-prepare-yout-eclipse-ide-for-web.html">here</a>) you should be ale to start your project. Start it and open your page with the form. Send some files (nothing will be done on the server as we haven't implemented doPost yet). </div>
<div>
The data captured by Fiddler looks like this</div>
<div>
<div>
<br /></div>
<div>
----------------------------------------------------------------------</div>
<div>
-----------------------------187161971819895</div>
<div>
Content-Disposition: form-data; name="example-input"; filename="file1.txt"</div>
<div>
Content-Type: text/plain</div>
<div>
<br /></div>
<div>
string 11</div>
<div>
string 12</div>
<div>
-----------------------------187161971819895</div>
<div>
Content-Disposition: form-data; name="example-input"; filename="file2.txt"</div>
<div>
Content-Type: text/plain</div>
<div>
<br /></div>
<div>
string 21</div>
<div>
string 22</div>
<div>
string 23</div>
<div>
-----------------------------187161971819895--</div>
</div>
<div>
----------------------------------------------------------------------</div>
<div>
<br /></div>
<h2>
Processing the data</h2>
<div>
The request sends the data divided by the parts. Once we get the request in the servlet we need the approach to distinguish those parts and handle each piece.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxhvxwLU70Psjyrx-6gX1JuHCIuxakdSzfs0K9rVYeu-d2vhVKaVV1bGj-EH-npRN9btaQVDbVN8g2sAW9HRAF-mQzLghwi39USp7XnsSGA7LuoHLPDSlL3ph-R9ud82wx5DGqN7N2neE/s1600/Servlet-Multipart.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Multipart schema - Upload several files with servlet example" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxhvxwLU70Psjyrx-6gX1JuHCIuxakdSzfs0K9rVYeu-d2vhVKaVV1bGj-EH-npRN9btaQVDbVN8g2sAW9HRAF-mQzLghwi39USp7XnsSGA7LuoHLPDSlL3ph-R9ud82wx5DGqN7N2neE/s1600/Servlet-Multipart.png" title="Multipart schema - Upload several files with servlet example" /></a></div>
<br /></div>
<div>
Servlet specification of version 3.0 provides convenient mechanism to parse such the parts. So let's see how to get the pieces of the request data</div>
<div>
<br /></div>
<div>
Collection<Part> webParts = req.getParts();</div>
<div>
<br /></div>
<div>
Now you have the collection of the separate parts. The last thing to we need to do is somehow print the file content and the file name. Here we encounter another pitfall of mutlipart processing. As it is seen from the capture dump both the files are assigned with the same input name "example-input" so we have to distinguish them basing on something else. The good choice is to do that by the file name. So we need to get <b>Content-Disposition</b> header for each retrieved part. Add the following method to your servlet:</div>
<div>
<br />
<pre class="brush: java"> private String getFileName(Part part){
Pattern p = Pattern.compile("filename=\"(.+?)\"");
Matcher m = p.matcher(part.getHeader("Content-Disposition"));
if(m.find()){
return m.group(1);
}else{
throw new IllegalStateException("Cannot fin filename in web request header.");
}
}
</pre>
<br /></div>
<div>
This method will help us to determine the file name which is stored in the part we're currently processing.</div>
<div>
Each part provides the inputStream so that one can retrieve the data from the part. Lets finally do the following steps:</div>
<div>
<ol>
<li>Get all the parts which are coming with the request</li>
<li>While coming through the collection get the inputStream of the item</li>
<li>Get the name of sequential file from the part</li>
<li>Wrap the inputStream of the sequential part with LineNumberReader.</li>
<li>Read the part content line-by-line</li>
<li>Print the lines to the servlet output (use resp.getWriter().println(..))</li>
</ol>
<div>
So the final result will be looking so:</div>
</div>
<div>
<br />
<pre class="brush: java">@MultipartConfig
public class HandlerServlet extends HttpServlet{
/**
*
*/
private static final long serialVersionUID = -717277851360696409L;
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
Collection<Part> webParts = req.getParts();
for(Part webPart: webParts){
resp.getWriter().println("File Name: " + getFileName(webPart));
LineNumberReader lnr = new LineNumberReader(new InputStreamReader(webPart.getInputStream()));
String line = null;
while((line = lnr.readLine()) != null){
resp.getWriter().println(line);
}
}
resp.flushBuffer();
}
private String getFileName(Part part){
Pattern p = Pattern.compile("filename=\"(.+?)\"");
Matcher m = p.matcher(part.getHeader("Content-Disposition"));
if(m.find()){
return m.group(1);
}else{
throw new IllegalStateException("Cannot fin filename in web request header.");
}
}
}
</pre>
</div>
<div>
That is it!</div>
<div>
<br /></div>
</div>
</div>
</div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-39568642371739542542012-12-21T10:49:00.000-08:002012-12-21T10:53:01.396-08:00What to do if nohup or disown does not work for you<div dir="ltr" style="text-align: left;" trbidi="on">
When I ran some application under Linux I encountered some common problem causing my application to stop once I was closing remote terminal session. Searching gave me an advice to use nohup or disown commands so that the process output is redirected from your console. That was assumed to resolve my problem, however it didn't. After I had closed my terminal window the processes were terminated.<br />
But what I did wrong (and probably you do as well) is that I ran all the commands from MC (aka Midnight Commander) shell. Since I used pure command line (no file managers or other mediator processes) I got the proper result. Hop it will help you.</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-5696732374400165912012-12-21T04:46:00.000-08:002013-01-18T15:39:29.923-08:00Regular expression to parse a double number<div dir="ltr" style="text-align: left;" trbidi="on">
Here is the simple example of how to validate your input is really a double value. But first here is a king of <b>WRONG</b> <i>regexp</i>: \d+.\d+ and variants of this example. Whats wrong with this expression. Well, it<br />
<br />
- DOES NOT match the sign (positive or negative)<br />
- Requires obligatary dot character<br />
- Requires obigatory digits after dot<br />
<br />
Now here is the <b><i>PROPER</i></b> expression: <i>^[\+\-]{0,1}([ 0-9]+\.){0,1}[ 0-9]+$</i><br />
<br />
- You may or may not set the sign before a number<br />
- You may parse values like these: <i>100, 100.0, 0.11, +1, -3000, -1.2</i><br />
- This expression makes you sure the string contains at least one digit<br />
<br />
However such the expression does not support parsing the values like 1.23e-10 etc, but it can e simply extended to support such ones.<br />
<br /></div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0Санкт-Петербург, Россия59.9395237 30.31202059999998358.9211437 27.730233599999984 60.9579037 32.893807599999981tag:blogger.com,1999:blog-5098962854350901144.post-83151375126278175982012-11-20T16:08:00.000-08:002012-11-20T16:08:46.831-08:00How to prepare your Eclipse IDE for web development<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<h2>
Objective </h2>
Once you're going to start developing some java-based web-applications or just static web-sites you need to perform some simple steps to configure your development environment. Basically you need three things to start developing:</div>
<ol style="text-align: justify;">
<li>Eclise IDE (J2EE edition)</li>
<li>Tomcat server (Servlet container and servlet specification implementation)</li>
<li>JDK to support basic java features along with runtime environment</li>
</ol>
<div style="text-align: justify;">
Lets go step-by-step here. At the moment of this post publishing the latest version of Eclipse IDE was Juno release. Download it <a href="http://eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr1">from here</a> so that you've got the version suitable for your operating system. I'm using Windows 7 64bit so all further statements will be related to it. </div>
<div style="text-align: justify;">
That will be great to create some sandbox so that you can use it as isolated disk space to have some practice. After you're pretty much familiar with the configuration you can repeat the steps with your own paths. Say, create the following folder where all the magic is going to happen: <b>c:/sandbox</b>. Create <b>Projects </b>subfolder to keep Eclipse project there.</div>
<div style="text-align: justify;">
<br />
<h2>
Configure your Eclipse and Tomcat instances</h2>
<div style="text-align: justify;">
Extract the eclipse archive to c:/sandbox. So you now have your IDE under c:/sandbox/Eclipse. Start it up (lets not talk about performance tuning of your IDE - this is not our topic here). Set up the workspace to Now you have IDE working. Unfortunately that's not enough to start coding. Close welcome screen.</div>
<div style="text-align: justify;">
You won't be able to code a piece of java code until you have JDK installed. Follow <a href="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html">this link</a> to download J2SE 6 for your operating system (make sure you're registered as oracle user as you will have to input your oracle credentials).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Install the distribution to <b>C:\sandbox\JDK_SE6</b>. Switch to Eclipse.</div>
<ul>
<li>Go to Window\Preferences</li>
<li>In the preferences tree go to Java\Installed JREs</li>
<li>Click [Add] button. Choose Standard VM in new dialog and click Next</li>
<li>Specify folder C:\sandbox\JDK_SE6 for JRE home. Once you do that all other fields are pre-filled automatically</li>
<li>Now you may remove all other VMs from the list if they are.</li>
<li>Click OK to close preferences dialog</li>
</ul>
You now can write and execute Java code. However we're going to create web application, aren't we? Hence we need to install servlet implementation. That's also good to have a web server. Fortunately all those stuff is combined under Apache Tomcat server. Lets use the latest version at the moment. You may take it from <a href="http://apache-mirror.rbc.ru/pub/apache/tomcat/tomcat-7/v7.0.32/bin/apache-tomcat-7.0.32.zip">here</a>. Unpack the content of the archive to our sandbox so that we have Apache Tomcat server under <b>C:\sandbox\apache-tomcat-7.0.32</b>.<br />
<br />
Lets bind eclipse to that apache instance.<br />
<ul>
<li>Go to Window\Preferences again. In preferences tree go to Server\Runtime Environments.</li>
<li>Click [Add...] button</li>
<li>In "New Server Runtime Environment" dialog choose Apache Tomcat v7.0. Check "Create a new local server" cehck-box. Click Next</li>
<li>Click [Browse...] button and choose the folder C:\sandbox\apache-tomcat-7.0.32</li>
<li>Under JRE you may choose either default JRE of workbench or JDK_SE6. They are all the same. However lets choose the second option to be more defined.</li>
<li>Click Finish and then OK to close preferences window. </li>
</ul>
<h2>
Creating a template project.</h2>
Lets now create some project to get aware how to create the project each time you want to start trying new create something new.<br />
<ul>
<li>In Eclipse press Ctrl+N so that "New" dialog is opened. </li>
<li>Choose "Dynamic Web Project" and click Next</li>
<li>There type some project name (note that the project path is attached automatically to our sandbox)</li>
<li>Choose Apache Tomcat v7.0 as target runtime</li>
<li>Set dynamic web module version to 3.0</li>
<li>Click Next until it gets disabled :)</li>
<li>There check the check-box "Generate web.xml deployment descriptor"</li>
<li>Finally click [Finish]</li>
</ul>
So.. Congratulations! You've now got web project configured. To make sure it's working lets do the following.<br />
<ul>
<li>In your Project Explorer expand WebContent folder</li>
<li>Right-click the folder and choose New->Html file</li>
<li>Name it <b>index.html</b> and click okay</li>
<li>Within <body>...</body> enclosure add piece of html-code like <h1>It really works!</h1>. Save the changes</li>
<li>Right click the project root in project explorer. Select "Run as -> Run on Server"</li>
<li>You should now see your html page which was deployed to the web-server and now loaded from it</li>
</ul>
That's all </div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-86609657010603843482012-08-08T06:52:00.001-07:002013-03-06T07:42:23.240-08:00Performance testing of web application built over long-polling architecture<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<blockquote class="tr_bq">
<span style="font-size: small;">Check <a href="http://razgulyaev.blogspot.com/p/test-management.html">new series of the articles</a>. Review and user experience on test management systems. Functionality and usability.</span></blockquote>
</div>
<div style="text-align: center;">
-------------------</div>
<br />
It's not a rocket science how to perform load testing of regular web application. Basically you need to measure the time between you send the request to the server and the time the server responds. Much harder is to test so called long-polling architecture where it becomes not reasonable to measure respond-request time as the respond time depends on actually two points:<br />
<br />
1. If the server has anything to say to your client it responds immediately<br />
2. If not, it waits for the threashold and responds breaking the connection which is restored immediately so a kind of persistant channel occurs.<br />
<br />
But wait. Does that mean we have no chance to consider the performance metrics to measure? Not actually.<br />
<br />
See the model of long polling communication I've prepared for you. The strong horizontal line here means the layer responsible for long-polling communication between the client (uasually your web-browser) and the server.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqXZjj2aLNo1CP5GHAOkpXw8k8pso-yn5eh-nHQQm4RzBRH0fFFUzH2ZC-ySqQq0Sy4WtEDt8op5IdPeoWRwUCBNp2N2-XbJQvgD6zvy7yhejsCJb1qw3agVKnlFJVGm3AGs5zx1ycNoo/s1600/long+polling+-+wm.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Performance testing (aka load testing) of long-polling web architecture" border="0" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqXZjj2aLNo1CP5GHAOkpXw8k8pso-yn5eh-nHQQm4RzBRH0fFFUzH2ZC-ySqQq0Sy4WtEDt8op5IdPeoWRwUCBNp2N2-XbJQvgD6zvy7yhejsCJb1qw3agVKnlFJVGm3AGs5zx1ycNoo/s400/long+polling+-+wm.PNG" title="" width="400" /></a></div>
<br />
<br />
(1) Client sends regular request to configure the server to know which information the client wants to recieve from the server.<br />
(2) Client sends the request asking if the server has requested data to publish. This request should be configured to have appropriate awaiting interval (bigger than a Threshold)<br />
(3) Server keeps the request while it has not data to publish. If the data is not ready in Threashold interval the server responds with corresponding message.<br />
(4) Client gets the response and recreates the request (all those client requests compose a kind of persistent data channel).<br />
(5) Once the data is ready the server respondes (6) to all the clients subscribed for it.<br />
<br />
So what we need to know is how fast the client gets published data. To find that out we should measure the interval between (5) and (6).<br />
<br />
But wait once again. The number of clients subscribed for certain data may be actually pretty big. Should we somehow consider this fact when measure the performance. Yep - we should. When the data is ready the server iterates though a pool of the subscribers and responds the corresponding requests. This means in such the case there will be a client which will get the respond later than others ones. Here we can consider two metrics of our application performance. They are:<br />
<br />
1. Time interval between the data gets ready on the server and the fact of getting it by the first client<br />
2. Time interval between the first and the last client gets the data<br />
<br />
P.S. - Performance testing of long-polling architecture is not easy stuff. To perform it effectively you sould be absolutely sure you can control the data readiness and synchronize it with client requests.<br />
<br />
<br />
<br />
<br /></div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-47215536832118712912012-08-06T07:31:00.000-07:002012-08-06T07:33:03.733-07:00Web Load Testing: When you can come up with single test user<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<div style="text-align: right;">
<i>All the measurements contain certain error. You will never get absolutely accurate value, so the only thing you can do with that is to accept that. </i></div>
<br />
<div style="text-align: justify;">
When you perfrom load testing of your web aplpication it is usually strongly recommended to use different user for each thread and it is quite reasonable. However in some cases you may consider the results reliable even if you use single credential to login for several threads. So how do you know if you can manage with the single test user. First of all you should figure out what you want to measure and what technologies you use.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The generic problem of single credential implies the server performs some data processing once the user requests the server resources the first time and then uses pre-evaluated data not spending the time for other requests. This highly depends on the technologies you use, on whether they support caching or whether they are so called statefull. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
HTTP server is orginally stateless machine. That means that all the "state" matters are supported by injecting so called cookies into the client browser. All the tools for load testing support completely isolated sessions for each thread. That's why some of the functional areas can be loaded with the help of only one user.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The good examples are </div>
<div style="text-align: justify;">
</div>
<ul>
<li>loading any static resource such as</li>
<ul>
<li>web pages</li>
<li>files</li>
<li>other data streams</li>
</ul>
<li>displaying the page with dynamic data not depending on the person looking at it</li>
<li>simple chat rooms (surprisingly)</li>
<li>authentication/authorization (again surprisingly). Even if your database caches requests you rather load HTTP server on authentication/authorization phase than a db server. So lot of threads will show you the problems (if they are) in your HTTP container configuration despite your db server will be still feeling okay.</li>
</ul>
<br />
<div style="text-align: justify;">
All these points do not ensure your success but rather are aimed to make you focus your attention on whether the architecture of your application is suitable for testing with single credentials. Each application is unique so you are still responsible for decision.</div>
</div><div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-65385600756644343522012-07-23T09:32:00.000-07:002013-07-08T07:22:45.668-07:00Web Load Testing Basics<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Looking through a number of forums I noticed that a lot of people are trying to get familiar with <u>JMeter</u> (so that they're capable to load test web servers) without understanding the basics of load-testing of http servers.</div>
<div style="text-align: justify;">
All what's told about here is actually the very common and the minimal stuff to know to start load testing with JMeter.</div>
<h2 style="text-align: justify;"><span>Whats the goal</span></h2>
<div style="text-align: justify;">
You may want to load your server due to several purposes (I would point out two of them). Actually one usually puts their own value to the terms, however I would propose to understand them in the following way.<br />
<br /></div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4IXGFf3sV5Ip9VDV4DYY6H6BeWaF58ZUN2_U0zd97Lh3fBxRLEPYVNAxB81X2yMUO-8YQu9dgPQhyphenhyphenkwTlwGDezISmbTnGp9wWsxFSpB_oUiXrbDMI3zksa2opuantpCvtr16GSmO7LqM/s1600/Chikatetsu.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Web load testing with JMeter" border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4IXGFf3sV5Ip9VDV4DYY6H6BeWaF58ZUN2_U0zd97Lh3fBxRLEPYVNAxB81X2yMUO-8YQu9dgPQhyphenhyphenkwTlwGDezISmbTnGp9wWsxFSpB_oUiXrbDMI3zksa2opuantpCvtr16GSmO7LqM/s320/Chikatetsu.jpg" title="" width="320" /></a></div>
</div>
<ul style="text-align: left;">
<li style="text-align: justify;"><span><u><b>Load Testing</b></u> - this is the regular testing implying you just track the reaction of your server for load injection. The main goal of such the tytpe of testing is to learn the dependency of how your resources are consumed against the portion of load. Starting from small loading you make the load rate igger and bigger and meanwhile you check how the correasponding components consume the resources. For example you may set the performance counters for processor time utilization and disk queue for the machine where your database is hosted. By increasing the numner of users trying to log in your system you may learn the tend on how your database responds. <u>So you're able to predict the resource consumption by extrapolating the trend.</u></span></li>
<li style="text-align: justify;"><span><u><b>Stress testing</b></u>. The main goal of such the type of testing is to check if the system is ready for real load spikes. It implies you inject the unusually huge loading and check mostly whether the system is still alive and no critical data is corrupted.</span></li>
</ul>
<h2 style="text-align: justify;">
<span>What makes the resources to be consumed.</span></h2>
<div style="text-align: justify;">
So we have http server. What makes it to consume more or less resources and wich component of your system are relevant to your goal? That highly depends on the architecture and what's your server actually doing. Any calculation usually consumes a lot of CPU time, working with data loads hard drive and RAM. So for newbies I would reccomend to set sch three counters for each node where you host your system's components. Likely they are at least: HTTP server, DB server (+ probably authorization server)</div>
<h2 style="text-align: justify;">
Should I completely emulate user's flow?</h2>
<div style="text-align: justify;">
Some start using JMeter from the simplest stuff like recording user interaction with JMeter proxy component. They usually get some tresh-looking stuff as proxy records the requests to every resource (however you can configure it to capture only the requests which meet certain patterns ). So whether we should keep all those requsts in load scenario? Whether they are relevant to the goals we set for our testing? Not indead.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Lets first recall the http conception. Http is the protocol which is originally intended to provide hypertext (actually just the formatted text) to the clients (aka browsers). Now the http server can also provide not only the hypertext but also media, some archived data, etc. All that can be described with umbrella-term "resource". So once you request html page you do rather request resource. Each resource on the server has its own URL (Uniform Resource Locator). That URL is basically the unique identifier that says to the server where it should take the resource from.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Server gets the URL requested by the client and then decides how to process it. Depending on the web container you're using the server redirects the request to dedicated process which returns the resource. So here the magic starts.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Actually the requested resource can either exist or even not. For example you may have static html page on the server. If you request that page the server usually just returns it to you (probably after your request authorization). Such the request type does not require lot of CPU time. It requre the disk time and probably some system specific resources (like free file descriptor). The most interseting things happen if some data you're requesting require pre-evaluation.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Assume you have dynamic content on your page. Before the server returns you the page it has to parse your html, evaluate the dynamic parts (probaly it will require sql query execution). This is what matters for the load testing.</div>
<h2 style="text-align: justify;">
Curse on record/playback aproach</h2>
<div style="text-align: justify;">
How the testers usually act to build the scenario. Testers usually somehow capture the real requests. They interact with the server using the web UI and either capture the scenario using JMeter proxy or capture the requests using browser-embedded tools. Such the approach has certain negative sides:</div>
<div style="text-align: justify;">
<br /></div>
<ol style="text-align: left;">
<li style="text-align: justify;"><span>You capture a lot of not required requests</span></li>
<li style="text-align: justify;"><span>It is hard to understand the logic of such the scenario after it's been built</span></li>
<li style="text-align: justify;"><span>In real life lot of the requests are supplied with parameters which are evaluated in different ways for particular session so they'll be obsolete in new one.</span></li>
</ol>
<h2 style="text-align: justify;">
<span>What pattern should I use to reproduce the user interaction?</span></h2>
<div style="text-align: justify;">
Follow the below rules until you're not skilled enough</div>
<div style="text-align: justify;">
<br /></div>
<ol style="text-align: left;">
<li style="text-align: justify;"><span>Find out if any resources are stored in third-party storages. Requesting such the resources should not be included in your scenario as we cannot impact the third-party components' performance</span></li>
<li style="text-align: justify;"><span>Avoid requesting static resources if you're not doing stress testing</span>
</li>
<ol>
<li style="text-align: justify;"><span>Find out if any files are generated on the fly. Such the files should be requested by your scenario as they consume processor time on generation phase. All other files shouldn't.</span></li>
<li style="text-align: justify;"><span>Tend to avoid requesting completely static html resources. They won't give you a picture of your server performance</span></li>
<li style="text-align: justify;"><span>Tend to avoid requesting javascript files. JMeter does not process javascript anyway and won't make your scenario easier</span></li>
</ol>
<li style="text-align: justify;"><span>Avoid proxies. Proxy will make you confused with your scenario as it will not be easy at all to read recorded samplers. If you don't use proxy it takes a bit more time to build your scenario but you can use the power of flow control components and parse the samplers output to provide the correct parameters which are specific for particular session.</span></li>
</ol>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The next time I'll touch the specific of error identification in your scenario.<br />
<br />
Read also some advanced stuff about the <a href="http://razgulyaev.blogspot.com/2012/08/performance-testing-of-web-application.html">approach to perform load testing of comet long-polling applications</a> (which is called by some people AJAX push).</div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-51643867523171618892012-07-19T10:47:00.000-07:002013-07-08T07:27:23.719-07:00Selenium 2 Java client: How to resolve apostrophes problem in xPath<div dir="ltr" style="text-align: left;" trbidi="on">
It's pretty much common problem how to handle apostrophes if you have to use them in attribute values or any text which you somehow use to narrow the search scope.<br />
<br />
Assume we need to find the <file> element having <u>name</u> attribute containing pattern "Someone's". Like</file><br />
<file><br /></file>
<pre class="brush: xml"><file name="Someone's name"/>
</pre>
<br />
The obvious way is to use the xPath like this: //file[contains(@name,'Someone's')]. However such the xPath won't be parsed properly as we've just broken the language syntax by placing three sequential single-quotes.<br />
<br />
The good approach to resolve such the problem is to use the <em>concat</em> construction so that the example above will look like this:<br />
<br />
//file[contains(@name,concat('Someone',"'",'s'))]<br />
<br />
Here we split the string by three parts and enclosed the single-quote with double-quotes. This is the good solution, however we still need the approach to build such the constructions whatever the number of single-quotes have the place and whatever combination with regular text they have as well<br />
<br />
Fortunately Java provides convenient facility to work with the strings and here I suggest the function helping to handle such the problem in your Selenium scenario.<br />
<br />
<pre class="brush: java"> String resolveAprostophes(String item){
if(!item.contains("'")){
return "'" + item + "'";
}
StringBuilder finalString = new StringBuilder();
finalString.append("concat('");
finalString.append(item.replace("'", "',\"'\",'"));
finalString.append("')");
return finalString.toString();
}
</pre>
So you can use it in such the way:<br />
<br />
<pre class="brush: java">String safeXPathToLocateTheElement = "//file[contains(@name," + resolveAprostophes("Someone's") + ")]";
</pre>
<br />
And then use it in your regular look-up patterns</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-51852983701907661522012-07-19T10:06:00.000-07:002012-07-19T10:06:28.480-07:00How to make JMeter to execute certain sampler in certain thread<div dir="ltr" style="text-align: left;" trbidi="on">
One day I needed to develop JMeter scenario so that it could execute certain samplers in certain threads and choose the order of sequential sampler execution according to certain algorithm. <em>Random Controller</em> was not an option as it actually does not guarantee that the next thread will run another sampler.<br />
<br />
Searching the solution led me to JMeter component reference page where they say that such the cases should be handled with so called <em>Interleave Controller</em>. However due to some reasone that silution didn't work for me. Probaly I couldn apply that emoponent properly, anyway I used another approach.<br />
<br />
1. Add a counter to your thread group so that it will store the numbr of sequential running thread in dedicated property (ex. <u>cntr</u>)<br />
2. Group the set of samplers you'd like to choose from with <em>Switch Controller</em><br />
3. Using javaScript expression specify the condition for "Switch Value" field like it is shown on the picture below<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhULTYonBnFj0Eq0Tb2gThf8kZ9I4A_wnVIptIIumgCjV6SYpDEPA6hyV4HpEex8l5ZjXwG1rPWdxdSvoPN9Ai03W4Jd7_6yh4DXZAVV1M2MoyrR-AqvC2IZa40lDVK2JDdLbZ5fYENLHM/s1600/SwitchController.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Example of Switch controller and javascript mod (%) operator" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhULTYonBnFj0Eq0Tb2gThf8kZ9I4A_wnVIptIIumgCjV6SYpDEPA6hyV4HpEex8l5ZjXwG1rPWdxdSvoPN9Ai03W4Jd7_6yh4DXZAVV1M2MoyrR-AqvC2IZa40lDVK2JDdLbZ5fYENLHM/s1600/SwitchController.PNG" title="" /></a></div>
This approach actually means that each time the new thread gets started the sequential number is generated by the conter. That value is stored in <u>cntr</u> property. Then the execution flow gets into <em>Switch Controller</em>. It evaluates the number of the item to be executed this time. Evealuation is performed with the help of <em>javascript mod operator</em>. Thus in above example we have two alternatives to choose from so we must get the reminder after devision current thread number by two. If we have <u>N</u> alternatives to choose from we must specify the following condition:<br />
<br />
${__javaScript(${cntr}%N)}<br />
<br />
That's it</div><div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-10048286527534630592012-07-11T05:40:00.001-07:002013-03-06T07:42:14.667-08:00Selenium 2: How to scroll to element using WebDriver<div dir="ltr" style="text-align: left;" trbidi="on">
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css"></link>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript">
</script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js" type="text/javascript">
</script>
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<blockquote class="tr_bq">
<span style="font-size: small;">Check <a href="http://razgulyaev.blogspot.com/p/test-management.html">new series of the articles</a>. Review and user experience on test management systems. Functionality and usability.</span></blockquote>
</div>
<div style="text-align: center;">
-------------------</div>
<br />
Some actions you take with WebElement's may fail due to those elements are not currently in the browser's visible area. So to make them able to interact you should first scroll vertically (or sometimes even horizontally :) ). However WebDriver does not provide explicit scrolling functionality.<br />
Nevertheless you can bring the required element to the viewport. To to that just do the
following<br />
<br />
<pre class="brush: java">((Locatable)element).getLocationOnScreenOnceScrolledIntoView();
</pre>
<br />
Where <u>element </u>is that WebElement you're going to interact with.</div>
</div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com3tag:blogger.com,1999:blog-5098962854350901144.post-20711683761094804992012-07-05T14:12:00.001-07:002012-07-06T05:42:27.682-07:00JMeter cluster in a nutshell.<div dir="ltr" style="text-align: left;" trbidi="on">
The pattern of JMeter clusterization implies that you have a number of hosts where JRE installed. You places there jmeter instances (just unpack jmeter distributions there). Then you start jmeter servers there. Since they're running you install master jmeter and configure it to target those nodes (ini file).<br />
<br />
You may use master jmeter in GUI mode to design your scenario. Once you're done you start the scenario for all the nodes (or for single node). When you start scenario for all the nodes each scenario instruction translates to java code and calls the corresponding methods of remote nodes via RMI. Remote nodes send back the results of execution so that you have the aggregated results of all the nodes you run the scenario for.<br />
<br />
You also can do all that stuff using non-gui mode.</div><div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-16879448532394330272012-07-05T13:46:00.000-07:002012-07-06T05:48:44.988-07:00How To Dump File Structure To XML. Part 3 (Final Part)<div dir="ltr" style="text-align: left;" trbidi="on">
In <a href="http://razgulyaev.blogspot.com/2012/06/how-to-dump-file-structure-to-xml.html">Part1</a> we learned how to operate with XSD schemas and design you XML-based DSL. Then in <a href="http://razgulyaev.blogspot.com/2012/06/how-to-dump-file-structure-to-xml-part.html">Part 2</a> we learned how to build the parser and apply the business logic to owr application. We made our application capable to store the file structure in XML file.<br />
<br />
Now we need the oposite operation. We need to restore file structure from XML file. Remember that that's only a structure, not the content, so every file will not hold a byte of information, just a name (aka record in file system).<br />
<br />
<h2 style="text-align: left;">
Validating XML file with XSD schema</h2>
<br />
So, check this snippet:<br />
<br />
<pre class="brush: java">public class XMLToFS {
public static void reproduce(String sourceFile) throws SAXException, IOException, JAXBException{
JAXBContext context = JAXBContext.newInstance(XTFSFolderRoot.class);
Unmarshaller reader = context.createUnmarshaller();
File schemaFile = new File("conf/fstoxml.xsd");
File sampleFile = new File(sourceFile);
validateAgainstSchema(schemaFile, sampleFile);
XTFSFolderRoot rootNode = (XTFSFolderRoot) reader.unmarshal(sampleFile);
long startTime = System.currentTimeMillis();
new FSCreator(rootNode).create();
System.out.println("Finished in " + String.valueOf(System.currentTimeMillis() - startTime) + " milliseconds");
}
static void validateAgainstSchema(File schema, File targetXml) throws SAXException, IOException{
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema referenceSchema = schemaFactory.newSchema(schema);
Validator schemaValidator = referenceSchema.newValidator();
schemaValidator.validate(new StreamSource(targetXml));
System.out.println("Xml file conforms specified schema.");
}
}
</pre>
<br />
<h2 style="text-align: left;">
XML recursive going round</h2>
This is the main acting class to reproduce the file system from an XML file. It requires the schema designed in previous posts to parse the input content genereated by previousely described functionality. This snippet is also the example of how to validate xml file against xsd schema. As it is seen it's quite simple - just use the pattern.<br />
After we have validated our input data, we should process the data to get the file structure. First we should create the root object from the data from file (aka unmarshall) - see line #9. Once we have the object we can pass it to the dedicated code to reporoduce the structure as the set of files on your hard drive. Such the functioality I incapsulated in FSCreator class. Here it is:<br />
<br />
<br />
<pre class="brush: java">public class FSCreator {
XTFSFolderRoot rootNode;
public FSCreator(XTFSFolderRoot rootNode){
this.rootNode = rootNode;
}
public void create() throws IOException{
File rootFolder = new File(rootNode.getPath());
if(!rootFolder.isDirectory()){
boolean isSuccess = rootFolder.mkdir();
if(!isSuccess){
throw new IOException("Root folder failed to get created");
}
}
reproduceFileFolderStructure(rootNode.getFolderOrFile(), rootFolder);
}
private void reproduceFileFolderStructure(List<XTFSFile> currentInput, File parent){
for(XTFSFile item: currentInput){
if(item instanceof XTFSFolder){
System.out.println("Processing folder " + parent.getAbsolutePath() + "\\" + item.getName());
File newParent = new File(parent, item.getName());
newParent.mkdir();
reproduceFileFolderStructure(((XTFSFolder) item).getFolderOrFile(), newParent);
}else if(item instanceof XTFSFile){
System.out.println("Processing file " + parent.getAbsolutePath() + "\\" + item.getName());
try {
new File(parent, item.getName()).createNewFile();
} catch (IOException e) {
System.out.println("Skipping due to IO error");
}
}else{
throw new IllegalStateException("Unrecognized class of the object");
}
}
}
}
</pre>
<br />
As you can see it uses recursive function to walk through a tree and process every node depending on its type. Point the attention to lines #22, #27. We have to check which type exactly the node implements as we process files and folders in different way. It is also very important how you order type check (it's important to check if the object is of Folder type first).<br />
<br />
The new and finalized application sources you can find <a href="https://bitbucket.org/arazgulyaev/fstoxml/src">here</a>. It now has combined dump/reproduce features with single entry point. You also may download <a href="http://goo.gl/qpPAK">the built solution which is ready to use</a>.</div><div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-65715031288815047852012-06-27T13:42:00.001-07:002012-07-06T05:53:10.658-07:00How To Dump File Structure To XML. Part 2.<div dir="ltr" style="text-align: left;" trbidi="on">
So, <a href="http://razgulyaev.blogspot.com/2012/06/how-to-dump-file-structure-to-xml.html">here in Part 1</a> of the post we prepared XSD schema keeping the data-model of our data we're going to store. Now we're ready to prepare parser, wrap it with some 'business-code' and try out.<br />
<h2 style="text-align: left;">
Generating JAXB parser classes</h2>
Let's do that. First of all locate your JRE (I'm sure you have one). There in /bin folder you should find xjc executable. Copy your schema there (let its name be fstoxml.xsd) and run the command 'xjc fstoxml.xsd'. What's it done? It converted the types described in your schema to the parser classes and put it to the package generated basing on the schema namespace. Check the previous part of the post to see the namespace. It is "http://www.notifymeplease.org/fstoxml/schema" which means the package will be "org.notifymeplease.fstoxml.schema". Refer to xjc help to know how to place the classes to different package.<br />
<br />
After xjc finishes processing you find the classes under the folders corresponding to the mentioned package. These are your XML parser. Add them to sources of your Java project and get ready to write business wrapper. One important thing to note: after you have added generated classes to your sources go to XTFSFolderRoot.java and add<u> @XmlRootElement(name = "root")</u> annotation just before class definition. That will indicate that the element is devoted to be the root one.<br />
<br />
<h2 style="text-align: left;">
Dump File Structure To XML</h2>
Remind that our business-need is to scan the file-structure (starting from some root) and dump it to XML file, so we need the recursive procedure to walk through the tree and the approach to save it. At the bottom of the page you may find the simple code with the comments describing everything that happens there.<br />
<br />
The code fetches the value of root property from the resource bundle. The thing to know about resource bundles is that<br />
- the file extension should always be 'properties' <br />
- if no language code specified in the property file name as the suffix, the default one will be used.<br />
- property file should be placed somewhere in classpath<br />
So for current example we should have conf.properties file under the classpath<br />
<br />
Then code creates 'root' object and fills it with the help of recursive procedure that goes across the underlying file system and populates the object dependencies.<br />
<br />
P.S. - You may find the project sources <a href="https://bitbucket.org/arazgulyaev/fstoxml/src">here</a>. <br />
P.P.S. - You may find the built application <a href="http://goo.gl/qpPAK">here</a>.<br />
P.P.P.S. - Here is the <a href="http://razgulyaev.blogspot.com/2012/07/how-to-dump-file-structure-to-xml-part.html">Part 3</a> where I'm telling how to reproduce file system from generated XML file<br />
To use the built application you should do the following<br />
<br />
1. Unpack the archive to somewhere<br />
2. Make sure you have JRE installed and JRE bin folder in your environment PATH variable<br />
3. In the folder you've unpacked the archive to set up the root folder to scan in conf.properties<br />
4. Run the command 'java -jar fstoxml.jar'. You should now see the generated file. For example the generated file for this project <b>src</b> folder looks like<br />
.<br />
<pre class="brush: xml"><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xtfsFolderRoot xmlns="http://www.notifymeplease.org/fstoxml/schema" path="C:\FSToXML\src">
<folder name="org">
<folder name="notifymeplease">
<folder name="fstoxml">
<file name="FSToXML.java"/>
<folder name="schema">
<file name="ObjectFactory.java"/>
<file name="package-info.java"/>
<file name="XTFSFile.java"/>
<file name="XTFSFolder.java"/>
<file name="XTFSFolderRoot.java"/>
</folder>
</folder>
</folder>
</folder>
</xtfsFolderRoot>
</pre>
<br />
.<br />
<h3 style="text-align: left;">
<span style="background-color: white;">Code Snippet.</span></h3>
This is the main code utilizing the parser.<br />
<br />
<pre class="brush: java">package org.notifymeplease.fstoxml;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import org.notifymeplease.fstoxml.schema.XTFSFile;
import org.notifymeplease.fstoxml.schema.XTFSFolder;
import org.notifymeplease.fstoxml.schema.XTFSFolderRoot;
public class FSToXML {
public static void main(String[] arg) {
ResourceBundle bundle = ResourceBundle.getBundle("conf");
File root = new File(bundle.getString("root"));
try {
// Creating JAXBContext to handle the classes from specified package
JAXBContext jaxbContext = JAXBContext.newInstance("org.notifymeplease.fstoxml.schema");
// Create marshaller to save data to disk
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));
// We should not start from not a directory
if (!root.isDirectory()) {
throw new IllegalStateException(
"Root should represent a folder. Current root: " + root.getCanonicalPath());
}
// Creating the main Node. The root of further xml output
XTFSFolderRoot rootNode = new XTFSFolderRoot();
// Specify attribute
rootNode.setPath(root.getCanonicalPath());
// Populate the content
long start = System.currentTimeMillis();
rootNode.getFolderOrFile().addAll(populateBody(root));
// Save to disk
marshaller.marshal(rootNode, new FileOutputStream("jaxbOutput.xml"));
System.out.println("Time spent(ms): " + String.valueOf(System.currentTimeMillis() - start));
} catch (IOException e) {
e.printStackTrace();
} catch (JAXBException e) {
e.printStackTrace();
}
}
/**
* Recursive method of populating the list
* @param root
* @return
*/
public static List<XTFSFile> populateBody(File root){
File[] newSet = root.listFiles();
ArrayList<XTFSFile> newList = new ArrayList<XTFSFile>();
// Having the sequential file (which actually may appear to be a folder)
for(File item: newSet){
// Check if it is a file
if(!item.isDirectory()){
/**
* It's a file, so just create new object,
* set the corresponding name
* and add it to the list
*/
XTFSFile newFile = new XTFSFile();
newFile.setName(item.getName());
newList.add(newFile);
}else{
/**
* It's a folder. so create folder object,
* set the name of the folder, and populate the content
* using the same method we're in now
*/
XTFSFolder newFolder = new XTFSFolder();
newFolder.setName(item.getName());
newFolder.getFolderOrFile().addAll(populateBody(item));
newList.add(newFolder);
}
}
// After all has finished, return the result
return newList;
}
}
</pre>
<br />
.</div><div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0tag:blogger.com,1999:blog-5098962854350901144.post-91002401851142349322012-06-27T10:04:00.001-07:002013-07-08T07:34:25.118-07:00How To Dump File Structure To XML. Part 1.<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
Goal: Having XSD grammar to describe file structure</h2>
Assume you want to reproduce (replicate) the file structure of some host you have no the direct access to. Assume you just want to save the file structure to perform some evaluation against it. The best way is to store it in XML file. This post is about how to do that. Also as a side effect the following topics're going to be slightly touched:<br />
<br />
- JAXB: How to generate xml file from scratch<br />
- How to apply XSD to build convenient XML parser via xjc.<br />
<br />
So first of all we need to design the schema of the data we're going to keep. Having such the schema will allow us to build the parser which will be used to write the data to xml and to read them from it in a very simple way. One may develop the schema by using either DTD or XSD specifications. The second one allows to use xjc translator from j2SE distribution to translate the schema to parser classes.<br />
<br />
<h2 style="text-align: left;">
What meta information do we need?</h2>
So let's consider the data structure we're going to process. This should represent the minimal meta-information of the file system. So it should support having the root node, files and folders which in turn should allow holding files and folders inside. Also the structural elements (files and folders) should have the attributes like "name" (mandatory one), "isHidden", "isArchived" etc.<br />
<br />
XSD is the format of describing the rules certain XML should be built with. It's a sort of grammar for a language which extends XML. XSD is also the XML so it can represent hierarchical structure where elements have the types dictating the way how one can (and allowed to) use them in their document meeting the schema. For example you cannot assign literal value to the attribute if you specified numeric type for it in the schema.<br />
<br />
XSD is the declarative language so that you describe the types (which btw can extend other ones), the relationships, restrictions etc. and then use this information depending on your current need (recall that our need is to build the parser)<br />
<br />
Such the declarative nature allows to process XSD with dedicated processors (aka translators) which can generate Java classes representing the types, dependencies and relationships of the entities described in the schema. Such the classes are marked with special annotations and getter methods so that they are easy to use to parse XML via JAXB (JavaXML Binding) technology.<br />
<br />
Let's check an example</div>
<br />
<pre class="brush: xml"><?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.notifymeplease.org/fstoxml/schema"
xmlns:tns="http://www.notifymeplease.org/fstoxml/schema" elementFormDefault="qualified">
<xs:element name="root" type="tns:XTFSFolderRoot"/>
<xs:complexType name="XTFSFolderRoot">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element name="folder" type="tns:XTFSFolder"/>
<xs:element name="file" type="tns:XTFSFile"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="path" use="required"/>
</xs:complexType>
<xs:complexType name="XTFSFolder">
<xs:complexContent>
<xs:extension base="tns:XTFSFile">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element name="folder" type="tns:XTFSFolder"/>
<xs:element name="file" type="tns:XTFSFile"/>
</xs:choice>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="XTFSFile">
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="isHidden" type="xs:boolean" use="optional"
default="false" />
<xs:attribute name="isReadOnly" type="xs:boolean" use="optional"
default="false" />
<xs:attribute name="isArchived" type="xs:boolean" use="optional"
default="false" />
</xs:complexType>
</xs:schema>
</pre>
<br />
<h2 style="text-align: left;">
Mapping "types" to "tags"</h2>
This simple schema represents the data structure we're going to use. It consists of three types description: XTFSFile, XTFSFolder (which extends XTFSFile) and XTFSFolderRoot. These types will be then translated to corresponding Java classes and will contain getter methods for each the attribute returning the values of specified types for those attributes.<br />
<br />
Note that the types do not mean tags in your xml which you're going to build according to this schema. To describe the rules of how to arrange the tags you should come up with so called "elements". Here in the example schema it is seen that we have element "root" (which describes how to use root tag in your XML). This element is of type <span>XTFSFolderRoot. Notice that when we refer to this type we have to specify the namespace of the document we're currently developing. This is required to </span><span>distinguish your custom types from the types of "</span><span>http://www.w3.org/2001/XMLSchema" namespace.</span><span> </span><br />
<span><br /></span>
<span>XTFSFolderRoot implies that we can have the sequence of "folder" or "file" tags under the "root" one. This sequence can be </span><span>infinite or it can not exist at all (</span><span>minOccurs="0" maxOccurs="unbounded"</span><span>). Folder and file tags should meet the rules described in </span><span>XTFSFolder</span><span> and </span><span>XTFSFile types correspondingly. Note that folder type implies holding elements of either files or folders which is actually the recursive dependency.</span><br />
<span><br /></span>
<span>Types also contain the attribute description with flags of whether they are required or not, and if not then which value to use by default if they are not specified in the document.</span><br />
<span><br /></span>
<span>So since we have this schema we can create some sample xml file and validate it to ensure the schema works correctly and catches all the places where the document doesn't meet it. However we are not going to use the schema to read the files but rather to write ones. Anyway we should translate it to the Java classes, include them to classpath and write the code to utilize them. </span><br />
<span><br /></span>
<span>All this stuff in the<a href="http://razgulyaev.blogspot.com/2012/06/how-to-dump-file-structure-to-xml-part.html"> Part 2 </a>of this post.</span></div>
<div class="blogger-post-footer">Thank you for subscribing my blog!</div>Grumpyhttp://www.blogger.com/profile/08725803228873294996noreply@blogger.com0