Xpath vs CSS Selectors

After researching and reviewing on whether to choose XPATH or CSS selector, the following are the points I came across.


Some points to CSS

Generally CSS is easy to use and readable over XPATH.



CSS is native to browsers and XPATH is not


CSS is preferred for testing as it is having more advantages over XPATH



Some points to XPATH

XPATH can travese up the document from a child element to parents.



Speed wise CSS and XPATH can be equal, or either one would be a bit speedier than other.

Therefore speed comparison can be ignored. However off the record, I have encountered that most mention that CSS is much faster than XPATH.




If we are down to select either CSS or XPATH reference, as I see we should compare the generated CSS and XPATH and select the better readable and short path locating string. Others comments are highly appropriated.


Additional Notes

Converting XPATH to CSS seletors: Following article layout on how to change XPATH element reference to CSS.


Differences between CSS and XPATH



A general guideline on how to select elements in a preferred order (where ID is the king)

A video presentation on how why CSS is preferred on many occations and comprehensive presentation on CSS vs XPATH for Selenium.



NUC machines might be the next desktop killer

While it seems like to CPU processing power is coming to a limitation, Intel is focusing on small form factor machines.


Installing Unlimited Strength Jurisdiction Policy Files for your JRE

Today in work, I had to use AES encryption to basically encrypt and secret text and store it somewhere. This is with Ruby language so I ended up using ‘aes’ gem as it is build on top of OpenSSL and provides simple set of methods that can be used to encrypt and decrypt strings.

Following is the Git repository location which also has some guidelines on using the gem.

Client wanted to use something similar to AES and we researched a bit and found it is easy to use for the situation. Basically in AES the key that is used for to encrypt is used to decrypt and get the original text.


However during execution when encryption and decryption methods are called, the following Java encryption key size limitation policy issue was occurred:

Error occurred when decrypting encrypted string with key: Illegal key size: possibly you need to install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for your JRE (RuntimeError)


As it turns out that the Cipher class will generally not allow encryption with a key size of more than 128 bits. The apparent reason behind this is that some countries (although increasingly fewer) have restrictions on the permitted key strength of imported encryption software.



Basically this is a forced restriction set by Java and can easily be fixed and there are two different solutions for this issue as mentioned in


Method 1 – Install the “Unlimited Strength” policy files from Oracle

In this approach it is required to install unlimited strength cryptography in the JVM, corresponding to Jenkins machine running java version:

After downloading the relevant zip file, the JAR files located in that should be replaced with the same JAR files found in “<java-home>/lib/security” . A detailed installation instruction should be also included in the zip file.


Method 2 – Disable the crypto restriction programmatically

There’s also a gem called ‘unlimited-strength-crypto’ that programmatically disables this limitation.


However as specified in the document (, this approach may apply to Java 7+ only.


As I see method 2 appears to be better as the situation is handled by a gem and easy to use. However as mentioned above, it is necessary to update the Java 7 or upper version. 


Setting up xdebug with phpstorm

This guide provide a step by step details on how to set up phpstorm IDE to work with xdebug.


First download xdebug and copy it into the extension folder. Copy the full path the extension.


Add the following xdebug settings to php.ini file.


php.ini file

zend_extension = “C:xamppphpextphp_xdebug-2.2.5-5.5-vc11.dll”
xdebug.profiler_enable = 1
xdebug.profiler_output_dir =”c:tmpxdebug”



Install easiest xdebug for Firefox and specify the remote IDE key for Firefox

Untitled picture

Then in the xdebug configuration apply following

Untitled picture

Put debug points and run the remote debug setting.

Untitled picture


enable the easiest debug and navigate the test page through the browser. Your debug should be hit, the request url is reading the debug file.



To stop breaking at the first line Untick Run->break and first line…