Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Error/Exception handling using SWTBot .
Error/Exception handling using SWTBot . [message #1013482] Sat, 23 February 2013 19:19
ajay shedge is currently offline ajay shedge
Messages: 5
Registered: February 2013
Junior Member
I need help with SWTBot for the below problem which i am facing from many days.

Please refer the attached screenshot. There are some fields in my application which has validations set in it. For eg
1. Db2 Administrator ID : Cannot start with number like (123456) or cannot be more than 8 characters.
2. Db2 Administrator Password : Cannot contain special characters,spaces,etc...
index.php/fa/13529/0/

I have written below code which runs perfectly for all positive cases.
bot.radio("Use an existing installation of DB2").click();
bot.textWithLabel("Location *").setText("C:\\Program Files\\IBM\\db2");
bot.textWithLabel("DB2 Administrator ID *").setText("ajay");
bot.textWithLabel("DB2 Administrator Password *").setText("ajay");
bot.textWithLabel("Confirm Password *").setText("ajay");
bot.textWithLabel("Database Name *").setText("ajaydb");
bot.textWithLabel("DB2 Port *").setText("50000");
bot.button("Next >").click();

But when i try to run the same code for negative cases like below, the program abruptly terminates.
bot.textWithLabel("DB2 Administrator ID *").setText("12345678");
bot.textWithLabel("DB2 Administrator Password *").setText("aj ay");

I tried to use below try and catch but i need to know how do i capture the error message that is shown in the application using bot :
try {
bot.textWithLabel("DB2 Administrator ID *").setText("12345678");
} catch (Exception e) {
e.printStackTrace(); // i do not see any stack trace here
}

Which Bot Object should i use to capture the "error message that is displayed on the application". I need to test this fields with negative scenarios continuously.

Thanks in advance.
Previous Topic:Where to get the SWTBot version for juno?
Next Topic:How to ues the EclipseSpy view on an Application?
Goto Forum:
  


Current Time: Thu Oct 02 10:30:53 GMT 2014

Powered by FUDForum. Page generated in 0.01892 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software