Hi

I am using click_by_xpath to execute a button which is an image input
type. As long as I know I need to specify :agent => :firefox to a
proper execution.
 I was wondering if there is a way of using the method click_by_xpath
and no browser is opened. I do not want that firefox open a browser
everytime I execute my program.
I also apreciate an alternate way of solve my problem.

Thanks you.

require 'rubygems'
require 'scrubyt'
require 'hpricot'
Hpricot.buffer_size = 262144
#Scrubyt.logger = Scrubyt::Logger.new


data = Scrubyt::Extractor.define :agent => :firefox do
 fetch 'http://web200.terminala.com/webpages/index.aspx'
 check_radiobutton
'ctl00$ContentPlaceHolder1$LeftPanelSearch1$JourneyType'
 fill_textfield
'ctl00$ContentPlaceHolder1$LeftPanelSearch1$txtctlOrigin', 'MAD -
Madrid, España'
 fill_textfield
'ctl00$ContentPlaceHolder1$LeftPanelSearch1$txtctlDestination', 'AMS -
Amsterdam Schiphol'
 select_option
'ctl00$ContentPlaceHolder1$LeftPanelSearch1$drpctlDepartureDate', '27'
 select_option
'ctl00$ContentPlaceHolder1$LeftPanelSearch1$drpctlDepartureMonthYear',
'nov 2009'
 click_by_xpath "//input
[...@id='ctl00_ContentPlaceHolder1_LeftPanelSearch1_btnSearch']"

     principio = 'ctl00_ContentPlaceHolder1_rptFlightResult_ctl0'
    finA = '_SearchPanel1_lblFlightNumber'
    finB = '_SearchPanel1_lblDepartureDate'
    finC = '_SearchPanel1_lblDepartTime'
    finD = '_SearchPanel1_lblArrivalTime'
    finE = '_SearchPanel1_lblDeptDurationValue'
    finF = '_SearchPanel1_lblAmountAdt'
    finG = '_SearchPanel1_lblEURCaptionAdt'
    num = 0
 while num < 5

precio "//sp...@id=#{principio+num.to_s+finf}]"
tipoMoneda "//sp...@id=#{principio+num.to_s+fing}]"
vuelo "//sp...@id=#{principio+num.to_s+fina}]"
fecha "//sp...@id=#{principio+num.to_s+finb}]"
salida "//sp...@id=#{principio+num.to_s+finc}]"
llegada "//sp...@id=#{principio+num.to_s+find}]"
duracion "//sp...@id=#{principio+num.to_s+fine}]"

num += 1
end
end
puts data.to_xml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to