ruby - Time is lost in frame control by watir -
i have performance problem in complex watir script. isolate part of code, , result :
# load browser , test page @browser = watir::browser.new :chrome @browser.goto ("http://myurl") # start inspect time of script puts "0 - start : " + time.new.inspect # active frame frame = @browser.frame(:id => 'myframe0123') puts "1 - frame variable : " + time.new.inspect puts frame.exists? puts "2 - getting frame src : " + time.new.inspect # play frame.link(:class => "playbutton").click # should fast puts "3 - clicking link in frame : " + time.new.inspect puts frame.exists? # should instant puts "4 - getting frame src : " + time.new.inspect # closing @browser.close
the code open test page, detect frame, , click link in frame.
here result in firefox :
0 - start : 2013-10-07 15:41:40 +0200 1 - frame variable : 2013-10-07 15:41:40 +0200 true 2 - getting frame src : 2013-10-07 15:41:40 +0200 3 - clicking link in frame : 2013-10-07 15:42:01 +0200 true 4 - getting frame src : 2013-10-07 15:42:54 +0200
the time lost :
- between 2 , 3 : don't understand how click on link in frame take 20s ?
- between 3 , 4 : how check of existence of fram take 50s ?
in chrome, whole script take less 10 seconds (as wish)
versions : ruby 1.9.3, watir-webdriver 0.6.4, firefox 21, 23, 24.
finally find why : in frame use, there image doesn't exist. firefox slow , wait domain respond, , why time lost.
Comments
Post a Comment