Using your customised messages in Twist assertions.

I am sure many of you would have felt the need of what I am going to write. Since, Twist uses Junit assertions methods for the assertions, so as it is dependent on Junit to pass on the error messages in case of failures.

Take an example where I am verifying a value of textbox name "Username" and use a Jnunit assertion like

assertEquals (Expected, seleneium.getText("Username"));

In case this step fails, it is going to show like ..

"Expected ['xyz'] but was ['yxz']", but this does not give me any information of the application context.

This becomes even more difficult, when we have a large test suite of big tests and looking at error message it is dificult to figure out, what failed exactly?

So, I would like to see an error message for the above example like -
"Username text expected [xyz], but was [yxz]", and this can be achieved by passing a context (String parameter), to the assertEquals method and then it will generate an error message with the context (Sring parameter). SO, I change the above bit of code to look like this....

assertEquals ("Username text", Expected, seleneium.getText("Username"));

And when this assertion fails, it will generate the error message in more meaning way, and also Twist HTML report will also change accordingly.

This is the simplest way we could do it so far, but I am sure Twist team is working on having its own assertion libraries and I am looking forward to that.

Project Migration in new Twist Beta

If you are using an older version of Twist Beta and want to migrate your test, you need not worry too much about it.

As soon as you open your project in the new Twist Beta, it will ask you to migrate the project. However, there is a manual option also available to migrate the project. (Right click on Twist project -> Migrate ).

It will update applicationcontext-suite.xml and twist.properties files, also it will add a folder names twist-conf with three configuration files in it.

New Twist Beta Update

We have upgraded ourselve to the new Twist Beta.

And this comes with some cool features.

- Inline Reporting

- Proxy settings

I have already spoken about this in my previous posts.



- Automatic variable assignment to an UI object while recording.


The way we have Incorporated the object repository concept in Twist by creating a single Java file to hold all the object information.

Rather then using object definitions directly in the script, which makes them brittle and hard to manage, we use the objects from the repository.  If something changes about that object, we know where exactly to find that object, and also that avoids making thousand changes if that particular object is being used quiet a lot.

And last not the least, recorder seems to be improved in the new Beta version and its really stable so far.

Twist - Bits - How to check selected value of a dropdown?

assertEquals(value, selenium.getSelectedLabel(locator));