Monday, June 29, 2015

The fast and easy check to assess a Test (QA) engineer in the interview.

An interesting question for QA engineer interview

When interview a QA engineer position I always ask a person to solve the problem like this:

  1. Assume you have a calculator to test (what a surprize)
  2. This calculator has some specific
    1. It accepts only the digits "0" and "1" as input
    2. It uses decimal numeration though
    3. It displays a result using 0-9
    4. It can display decimal fraction
    5. However it does not accept input of decimal fraction
    6. It can dispay negative numbers
    7. However it does not accept input of negative number
    8. It supports the only two operations: division and substraction
    9. It supports sequential input without the need of pressing "=" (e.g. 10/1/10 = 1)
    10. It displays only 5 digits on a screen, however it accepts 6 digit input so that the most significant digit is not shown. It still takes part in calculation.
QA testers interview task problem questions

Here on the picture the example of such the calculator is shown. The number on the screen is showing one of the possible calculation results produced by the device. The task for a candidate it to :
  1. design as many test cases for this system as possible
  2. Select 5 cases that the candidate would run (the most important ones) if there would not be enough time for comprehesive testing.
That question shows if the candidate can solve the problems which have some specific as against the well-known but resembling ones. It also shows if the candidate can ask the "right" questions and look for the relevant requirements.

Friday, January 23, 2015

Eclipse hangs on start up after proxy configuration change

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:

  1. Go to your eclipse installation folder
  2. Switch to configuration/.settings
  3. Open file org.eclipse.core.net.prefs
  4. Set all the boolean properties related to proxy to false
  5. Save the changes
  6. Start Eclipse again
This solution has worked for me. Hope it will work for you as well.

Eclipse xpath parser fails to search elements by the tag names

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.
Example:

<apprepo xmlns="asdasd">
<app name="good-app">
<appinfo>
<author name="John Smith"/>
<stores>
<store name="goo" price="1"/>
<store name="app" price="1.5"/>
</stores>
</appinfo>
</app>
<app name="another-good-app">
<appinfo>
<author name="James Smith"/>
<stores>
<store name="goo" price="2"/>
</stores>
</appinfo>
</app>
</apprepo>

Query: //appinfo returns "no matches"

Let's now change the namespace so that it is bound to some prefix (let's even not use that prefix in our document)

<apprepo xmlns:pref="asdasd">
<app name="good-app">
<appinfo>
<author name="John Smith"/>
<stores>
<store name="goo" price="1"/>
<store name="app" price="1.5"/>
</stores>
</appinfo>
</app>
<app name="another-good-app">
<appinfo>
<author name="James Smith"/>
<stores>
<store name="goo" price="2"/>
</stores>
</appinfo>
</app>
</apprepo>

Result: query returns all the appinfo nodes found

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.

Thursday, December 11, 2014

Tip: add element to JScrollPane with not specifying it in constructor

Tip: If you created JScrollPane object and didn't set the scrollable client as the constructor parameter, you can add it later by invoking setViewportView method of JScrollPane.

Thursday, December 04, 2014

Caption text disappears on JButton if Action is assigned

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
Swing for a long time but I spent a day to find the solution out.

So I had the code to create JButton with caption like

JButton jbPerformSomeJob = new JButton("Perform Some Job");

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.

So after that I added some Action to my button as anonymous class object.

jbPerformSomeJob.setAction(new AbstractAction() {

@Override
public void actionPerformed(ActionEvent e) {
performCustomJob();
}
});

After I started the application again I couldn't see the caption on the button any more.

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:

class PerformSomeJobAction extends AbstractAction{

public GenerateReportAction(String text) {
super(text);
}

@Override
public void actionPerformed(ActionEvent e) {
performCustomJob();
}

}

and use the following construction for my JButton

jbPerformSomeJob.setAction(new PerformSomeJobAction("Perform Some Job"));

Thursday, November 27, 2014

Error executing Proguard in Eclipse

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.

Monday, September 09, 2013

Apache Felix fails to run in background (including nohup case)

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 Apache Felix and the exceptions told something like:

java.util.zip.ZipException: ZipFile closed
at java.util.zip.ZipFile.ensureOpenOrZipException(ZipFile.java:642)
at java.util.zip.ZipFile.access$1300(ZipFile.java:56)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:675)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:413)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at org.apache.felix.framework.util.WeakZipFileFactory$WeakZipFile$WeakZipInputStream.read(WeakZipFileFactory.java:707)

or

Spring DM context shutdown thread WARN 06/09 14:35:39 [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Exception
thrown from ApplicationListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context:
OsgiBundleXmlApplicationContext(bundle=org.squashtest.tm.plugin.testautomation.jenkins, config=osgibundle:/META-INF/spring/*.xml): startup date
[Fri Sep 06 14:35:34 BST 2013]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:340)

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:

  1. As it's recommended here check if you have ConsoleHandler enabled for your Log4j and disable it using the following entry: java.util.logging.ConsoleHandler.level = OFF (if you're using property file to configure your logging. otherwise use the xml equivalent)
  2. Drop the bundles holding -shell suffix from your Bundles folder. They could look like the following:
    1. org.apache.felix.shell.tui-version.jar
    2. org.apache.felix.gogo.shell-version.jar
  3. As the alternative of the previous step you may add -Dgosh.args=--nointeractive  option to the jvm arguments on calling your app from sh sctipt
  4. Run your application in the regular way like nohup ./startup.sh &
This should help.