[Testing] Selenium webdriver + Minitest + SQLite3

13 views
Skip to first unread message

João Bordalo

unread,
Sep 4, 2018, 11:38:42 AM9/4/18
to Ruby on Rails: Talk
Hi there,

I have a rails application (version 3.2.22). And now I'm creating functional tests through browser using Selenium Webdriver(for browser interaction) and Minitest (to validate).

Before running my test script (that fills a form and submits), I launch the rails server in order to selenium access the application.

Problem: When the selenium 'clicks' on the submit button, the server raises the following error related to Sqlite:

SQLite3::BusyException: database is locked: commit transaction

I have tried a lot of things that the stack overflow and other articles suggested, however, none has worked so far.

So, do you have any ideia why htis is happening and how to fix this?

Thank You in advance,
João Bordalo

Hassan Schroeder

unread,
Sep 4, 2018, 12:38:06 PM9/4/18
to rubyonrails-talk
On Tue, Sep 4, 2018 at 8:38 AM, João Bordalo <bordalo...@gmail.com> wrote:

> Problem: When the selenium 'clicks' on the submit button, the server raises
> the following error related to Sqlite:
>
> SQLite3::BusyException: database is locked: commit transaction

You've confirmed this succeeds when you perform this same operation
manually? I would wonder if Selenium is somehow generating two click
events, but that's a WAG.

Is there a stack trace you can post?


--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

João Bordalo

unread,
Sep 4, 2018, 1:05:56 PM9/4/18
to Ruby on Rails: Talk
You've confirmed this succeeds when you perform this same operation 
manually? I would wonder if Selenium is somehow generating two click 
events, but that's a WAG. 

I have tried it manually and It works as it is supposed to ( the form is submitted currently to database).

Is there a stack trace you can post?
No, it is the server that raises the error, not the selenium script

Hassan Schroeder

unread,
Sep 4, 2018, 1:22:01 PM9/4/18
to rubyonrails-talk
On Tue, Sep 4, 2018 at 10:05 AM, João Bordalo <bordalo...@gmail.com> wrote:

> Is there a stack trace you can post?
> No, it is the server that raises the error, not the selenium script

? Where are you seeing the error? If it's server-generated then I'd
expect *something* in the logs, hopefully including a stacktrace.

João Bordalo

unread,
Sep 5, 2018, 10:43:25 AM9/5/18
to Ruby on Rails: Talk
Thank you for your attempts.
I noticed that i was trying to read DB on my selenium script while server was trying tu write on the same DB.
Removed those lines and it is working fine.
Reply all
Reply to author
Forward
0 new messages