Keywords for database testing

511 views
Skip to first unread message

tmpalaniselvam

unread,
Sep 20, 2010, 9:19:07 AM9/20/10
to robotframework-users
Hi,

My web applications needs reasonable amount of database testing. I
thought to use SeleniumLibrary and DBLibrary. But DBLibrary is using
Jython (Java) only. Also I need to add/extend few keywords for
database testing. Many cases are needed to validate with multiple row
data. As of now, Application supports DB2. In future, it may support
Oracle and MS SQL Server.

I'm thinking that I can learn Python and implement specific
functionality with certain keywords. I need your suggestions..

Thanks,
Palani.

Pekka Klärck

unread,
Sep 22, 2010, 3:37:24 AM9/22/10
to palani...@gmail.com, robotframework-users
2010/9/20 tmpalaniselvam <palani...@gmail.com>:

This has actually been discussed before [1]. I don't have too much
experience from db stuff with Python, but I've heard good things about
SQLAlchemy [2]. As discussed in [1], Radek started a project to create
a database testing library for Robot using it, but that code doesn't
seem to available anymore.

[1] http://groups.google.com/group/robotframework-users/browse_thread/thread/b7f1598b0751f57a/fe2e635bd02ba926
[2] http://www.sqlalchemy.org/

Another alternative is using the Java based Database library [3] via
the Remote library interface [4]. This stuff is discussed in the
thread where the Database library was announced [5].

[3] http://code.google.com/p/robotframework-dblibrary/
[4] http://code.google.com/p/robotframework/wiki/RemoteLibrary
[5] http://groups.google.com/group/robotframework-users/browse_thread/thread/af49201295156ad6/c29249d386d043ee

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Mika Hänninen

unread,
Sep 22, 2010, 5:25:49 AM9/22/10
to robotframework-users
I have Python based Database Libraries for MySQL (using Python MySQLdb
module) and Oracle (using Python cx_Oracle module), but I don't know
if I have time to construct these to be publicly available.

-Mika

On Sep 22, 10:37 am, Pekka Klärck <p...@iki.fi> wrote:
> 2010/9/20 tmpalaniselvam <palani.sel...@gmail.com>:
>
>
>
> >  My web applications needs reasonable amount of database testing. I
> > thought to use SeleniumLibrary and DBLibrary. But DBLibrary is using
> > Jython (Java) only. Also I need to add/extend few keywords for
> > database testing. Many cases are needed to validate with multiple row
> > data. As of now, Application supports DB2. In future, it may support
> > Oracle and MS SQL Server.
>
> > I'm thinking that I can learn Python and implement specific
> > functionality with certain keywords. I need your suggestions..
>
> This has actually been discussed before [1]. I don't have too much
> experience from db stuff with Python, but I've heard good things about
> SQLAlchemy [2]. As discussed in [1], Radek started a project to create
> a database testing library for Robot using it, but that code doesn't
> seem to available anymore.
>
> [1]http://groups.google.com/group/robotframework-users/browse_thread/thr...
> [2]http://www.sqlalchemy.org/
>
> Another alternative is using the Java based Database library [3] via
> the Remote library interface [4]. This stuff is discussed in the
> thread where the Database library was announced [5].
>
> [3]http://code.google.com/p/robotframework-dblibrary/
> [4]http://code.google.com/p/robotframework/wiki/RemoteLibrary
> [5]http://groups.google.com/group/robotframework-users/browse_thread/thr...

tmpalaniselvam

unread,
Sep 23, 2010, 1:25:30 AM9/23/10
to robotframework-users
Hi pekka,

Initially I tried with DB2 python library. It will not be helpful to
keep single RF library for different type of databases. Now I have
taken pyodbc and created few keywords just to retrieve the data.
Tested for DB2 & Oracle through DSN. Still I need to add support for
DSN-less connections for different databases.

I hope that it might be available on next month. Also plan to develop
all keywords, which are available from Java based Database library.
Before that I need your help for making setup and auto-documentation.

Thanks,
Palani.

Pekka Klärck

unread,
Sep 24, 2010, 7:26:49 AM9/24/10
to palani...@gmail.com, robotframework-users
2010/9/23 tmpalaniselvam <palani...@gmail.com>:

>
> Initially I tried with DB2 python library. It will not be helpful to
> keep single RF library for different type of databases. Now I have
> taken pyodbc and created few keywords just to retrieve the data.
> Tested for DB2 & Oracle through DSN. Still I need to add support for
> DSN-less connections for different databases.
>
> I hope that it might be available on next month. Also plan to develop
> all keywords, which are available from Java based Database library.
> Before that I need your help for making setup and auto-documentation.

Sounds good. Having a Python based database library with the same
keywords as the Java version would be great, because then it would be
possible to run the same tests both on Python and Jython interpreters.
Not needing to write the same keyword documentation, and first of all
deciding what keywords to implement, would also ease developing the
Python library.

An arguably better solution would be having just one library that
works both on Python and Jython (and possibly on IronPython too).
SQLAlchemy has had Jython support since 0.6 version [1], so that might
not be too much more complicated than creating a library only for
Python.

[1] http://www.sqlalchemy.org/news.html

Reply all
Reply to author
Forward
0 new messages