Click Button in IFrame timeout in vapir 1.7.0. Any suggestions?

18 views
Skip to first unread message

xul...@yahoo.com

unread,
Aug 6, 2010, 8:04:12 PM8/6/10
to Vapir
Hi Folks,

I got the following error when click the "Next" button to next screen
which include the same button id in the next screen, Any suggestions
to resolve this issue, Can I just change the timeout parameter in
firefox.rb in vapir pkg?

Your assistance is highly appreciated.

Regards,

xulivan

xul...@yahoo.com

unread,
Aug 6, 2010, 8:11:15 PM8/6/10
to Vapir
Sorry, I missed paste the output of the msg.
irb(main):006:0> ie_offer.frame(:name,"screens").button(:id,'forward-
button-159448-').click
RuntimeError: Waiting for requests in progress to complete timed out.
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-common-1.7.0/lib/
vapir-common/waiter.rb:137:in `try_for'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/firefox.rb:598:in `wait'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/element.rb:228:in `wait'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/element.rb:95:in `fire_event'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-common-1.7.0/lib/
vapir-common/element.rb:740:in `with_highlight'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-common-1.7.0/lib/
vapir-common/container.rb:108:in `assert_exists'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-common-1.7.0/lib/
vapir-common/element.rb:733:in `with_highlight'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/element.rb:86:in `fire_event'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/element.rb:196:in `click'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/element.rb:193:in `each'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/element.rb:193:in `click'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-common-1.7.0/lib/
vapir-common/element.rb:740:in `with_highlight'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-common-1.7.0/lib/
vapir-common/container.rb:108:in `assert_exists'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-common-1.7.0/lib/
vapir-common/element.rb:733:in `with_highlight'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/element.rb:190:in `click'
from (irb):6
from :0irb(main):007:0>

Ethan

unread,
Aug 7, 2010, 12:44:18 AM8/7/10
to va...@googlegroups.com
What does the browser appear to be doing when this is happening - is it waiting for a page to load, or an ajax call to return, or anything? Or does it appear to be done, and vapir should not be waiting for it? 

xul...@yahoo.com

unread,
Aug 7, 2010, 2:26:20 AM8/7/10
to Vapir
Dear Ethan,

Thanks for prompt reply.
Actually, page already loaded with IFrame content with button inside.
when click the button. (my case is "Next" button,). it will go to next
page which has the same button name but different content in the
IFrame. the vapir click event was triggered and page was loaded to the
second page, but it hang until timeout. I changed timeout parameter up
to 180 seconds, still happened.
I guess there is dead loop due to the new page has the same button
name.
Again,thanks for your assistance in this matter. I need this to move
forward our web testing.

Xulivan

On Aug 6, 9:44 pm, Ethan <notet...@gmail.com> wrote:
> What does the browser appear to be doing when this is happening - is it
> waiting for a page to load, or an ajax call to return, or anything? Or does
> it appear to be done, and vapir should not be waiting for it?
>

xul...@yahoo.com

unread,
Aug 7, 2010, 2:48:33 AM8/7/10
to Vapir
Dear Ethan,

To be more accurate, This is popup window which include all content,
when click next button, JavaScript will decide which other content
show upon the sequence.
So, when click next button, there is no page loading happen, only
JavaScript run to show content.
hope this information helps to debug this issue. our IE browser
testing has no this issue using watir (I didn't try vapir-ie yet).
thanks,
xulivan

Ethan

unread,
Aug 7, 2010, 2:54:29 AM8/7/10
to va...@googlegroups.com
well, vapir-firefox attempts to see if firefox is still downloading stuff on the page, by keeping track of how many server requests firefox has made that haven't completed. that error message indicates that there is still a incomplete request - or maybe it indicates that the code that attempts to keep track of that stuff has a bug. 

is the site that you're testing public - can you point me to a page where I can attempt to reproduce this myself, to debug it? 

if that is not possible, can you attempt the following to see if it fixes the problem? 
- open this file in a text editor: C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/vapir-firefox/firefox.rb
- line 343 should be the start of a comment, looks like:            /*
- change that to a blank line
- on line 350, the comment is closed, looks like:            }*/
- remove the */ to change that to a single closing curly brace, looks like:    }

with that uncommented, run your code again, see if that fixes the problem, let me know. 

thanks
-Ethan

xul...@yahoo.com

unread,
Aug 7, 2010, 3:18:38 AM8/7/10
to Vapir
I changed the line you mentioned. no luck.
thanks. any other options?

xulivan

On Aug 6, 11:54 pm, Ethan <notet...@gmail.com> wrote:
> well, vapir-firefox attempts to see if firefox is still downloading stuff on
> the page, by keeping track of how many server requests firefox has made that
> haven't completed. that error message indicates that there is still a
> incomplete request - or maybe it indicates that the code that attempts to
> keep track of that stuff has a bug.
>
> is the site that you're testing public - can you point me to a page where I
> can attempt to reproduce this myself, to debug it?
>
> if that is not possible, can you attempt the following to see if it fixes
> the problem?
> - open this file in a text
> editor: C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/vapir-firefox/firefox.rb
> - line 343 should be the start of a comment, looks like:            /*
> - change that to a blank line
> - on line 350, the comment is closed, looks like:            }*/
> - remove the */ to change that to a single closing curly brace, looks like:
>    }
>
> with that uncommented, run your code again, see if that fixes the problem,
> let me know.
>
> thanks
> -Ethan
>

Ethan

unread,
Aug 7, 2010, 3:27:30 AM8/7/10
to va...@googlegroups.com
it gives the same error? 

xul...@yahoo.com

unread,
Aug 7, 2010, 3:40:18 AM8/7/10
to Vapir
Yes, exactly the same.
Thanks,
xulivan

On Aug 7, 12:27 am, Ethan <notet...@gmail.com> wrote:
> it gives the same error?
>

xul...@yahoo.com

unread,
Aug 7, 2010, 3:49:29 AM8/7/10
to Vapir
btw, I can only use watir to attach IE pop up window with click those
next button and back button. which works fine.
irb(main):013:0> ie_offer.frame(:name,"screens").button(:id,'back-
button-159449-').click
=> 0.204
irb(main):014:0> ie_offer.frame(:name,"screens").button(:id,'forward-
button-159448-').click
=> 0.203
irb(main):015:0> ie_offer.frame(:name,"screens").button(:id,'back-
button-159449-').click
=> 0.218

but I can't use vapir-ie to attach the same popup window.
do you have different way to attach IE using vapir-ie?

thanks,

Ethan

unread,
Aug 7, 2010, 3:50:32 AM8/7/10
to va...@googlegroups.com
dang. 
well, you can comment or delete lines 598-600 (three lines) of that same file. that will remove that check entirely. 
is there a way that I might be able to see the site you are testing, to try to reproduce / debug? 

Ethan

unread,
Aug 7, 2010, 3:51:23 AM8/7/10
to va...@googlegroups.com
the same code should work in vapir. are you getting an error? if so, what? if not, what is it doing? 

xul...@yahoo.com

unread,
Aug 7, 2010, 3:56:12 AM8/7/10
to Vapir
Sorry, this is internal web application which I couldn't share.
to attach using vapir-ie. i got the following error, but no errors in
watir for IE though.

irb(main):002:0> ie_offer=Vapir::IE.attach(:title,/.*Title.*/)
ArgumentError: bad value for range
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/page_container.rb:186:in `all_frames_complete?'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/page_container.rb:199:in `all_frames_complete?'
from (irb):2:in `all?'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/page_container.rb:186:in `each'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/page_container.rb:186:in `all?'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/page_container.rb:186:in `all_frames_complete?'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/page_container.rb:144:in `wait'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-common-1.7.0/lib/
vapir-common/waiter.rb:127:in `try_for'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/page_container.rb:142:in `wait'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/ie-class.rb:152:in `_attach_init'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-ie-1.7.0/lib/vapir-
ie/ie-class.rb:144:in `attach'
from (irb):2

Thanks

On Aug 7, 12:51 am, Ethan <notet...@gmail.com> wrote:
> the same code should work in vapir. are you getting an error? if so, what?
> if not, what is it doing?
>

xul...@yahoo.com

unread,
Aug 7, 2010, 4:04:31 AM8/7/10
to Vapir
Thanks Ethan,

After I commented out the 598-600. it works fine.

Another question, when I attach firefox popup window. I have to open a
new one first and close it, then attach. is it the right method.

thanks millions.

xulivan

Ethan

unread,
Aug 7, 2010, 5:50:26 PM8/7/10
to va...@googlegroups.com
I'm glad that worked - I will attempt to investigate why it might be thinking that it's incomplete. Or at least put an option in the next version which will let you turn this off. 

For attaching to a popup window - I'm not really following this, I'm sorry. This is a popup web page (as opposed to a javascript popup alert/confirm dialog)? If so you should be able to just use Vapir::Firefox.attach to attach to it. 

xul...@yahoo.com

unread,
Aug 7, 2010, 6:51:45 PM8/7/10
to Vapir
This is not regular popup window with alert or confirm in Javascript.
there are lots of content which could be displayed when you click
"Next" or "Back" button.

If I didn't use the ie_offer=Vapir::Firefox.new first.

I got the following error.
irb(main):001:0> require 'vapir-firefox'
=> true
irb(main):002:0> ie_offer=Vapir::Firefox.attach(:title,/.*Title.*/)
Vapir::Exception::NoBrowserException: cannot attach using
[:title, /.*Title.*/] - could not connect to Firefox with JSSH
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/firefox.rb:157:in `initialize'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/firefox.rb:448:in `new'
from C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/
vapir-firefox/firefox.rb:448:in `attach'
from (irb):2

If I use new first.then close, everything works fine. (but it is
annoying though when test our web application. there is new firefox
browser open and close everytime.)

irb(main):002:0> ie_offer=Vapir::Firefox.new
=> #<Vapir::Firefox:0x3238f90 url="http://www.google.com/firefox?
client=firefox-a&rls=org.mozilla:en-US:official" title=
"Mozilla Firefox Start Page">
irb(main):003:0> ie_offer.close


On Aug 7, 2:50 pm, Ethan <notet...@gmail.com> wrote:
> I'm glad that worked - I will attempt to investigate why it might be
> thinking that it's incomplete. Or at least put an option in the next version
> which will let you turn this off.
>
> For attaching to a popup window - I'm not really following this, I'm sorry.
> This is a popup web page (as opposed to a javascript popup alert/confirm
> dialog)? If so you should be able to just use Vapir::Firefox.attach to
> attach to it.
>
> ...
>
> read more »

Ethan

unread,
Aug 7, 2010, 10:04:14 PM8/7/10
to va...@googlegroups.com
It doesn't seem that vapir is able to connect to jssh. When you launch firefox from vapir using Firefox.new, the -jssh option is passed so that vapir can connect, but if firefox is not launched by vapir, then the -jssh option needs to be passed by whatever launches it, in order for vapir to be able to connect. how is firefox being launched when you are not using Vapir::Firefox.new? 

xul...@yahoo.com

unread,
Aug 7, 2010, 11:34:26 PM8/7/10
to Vapir
Thanks Ethan,
you are right. as long as firefox was launched by vapir, attach method
works fine.

On Aug 7, 7:04 pm, Ethan <notet...@gmail.com> wrote:
> It doesn't seem that vapir is able to connect to jssh. When you launch
> firefox from vapir using Firefox.new, the -jssh option is passed so that
> vapir can connect, but if firefox is not launched by vapir, then the -jssh
> option needs to be passed by whatever launches it, in order for vapir to be
> able to connect. how is firefox being launched when you are not using
> Vapir::Firefox.new?
>
> ...
>
> read more »

Ethan

unread,
Aug 8, 2010, 12:10:46 AM8/8/10
to va...@googlegroups.com
You can also modify the shortcut that you use to launch firefox to launch "firefox.exe -jssh" instead of just "firefox.exe" 

xul...@yahoo.com

unread,
Aug 25, 2010, 8:08:47 PM8/25/10
to Vapir
Hi Ethan,

This patch was not in the release 1.7.1. right?

Do you have plan to put this patch into the next release so that I
don't need patch after I upgrade to next version.

thanks,

xulivan

On Aug 7, 9:10 pm, Ethan <notet...@gmail.com> wrote:
> You can also modify the shortcut that you use to launch firefox to launch
> "firefox.exe -jssh" instead of just "firefox.exe"
>
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages