|
Re: automated testing with browsers: msg#00036web.selenium.user
This isn't the best way to do some of this stuff (I've since found better ways, but haven't updated the code): # Open the file in the browser. # Mac OS if(@os == MACOS) #assuming Firefox for now--Fortius has problems with Safari `open "#{suite}#{url_suffix}"` if(@browser == SAFARI) fork {`/Applications/Firefox.app/Contents/MacOS/firefox- bin "#{suite}#{url_suffix}"`} if(@browser == FIREFOX) end # Linux if(@os == LINUX) if(@browser == FIREFOX) end end # Windows if(@os == WINDOWS) `start #{suite}#{windows_url_suffix}` if(@browser == IE) `start firefox.exe #{suite}#{windows_url_suffix}` if (@browser == FIREFOX) end # Join the thread, then quit the browser processor_thread.join # Quit the browser puts @os, @browser if(@os == MACOS) #assuming Firefox for now if(@browser == FIREFOX) line = `ps -A | grep "Firefox.app"` process = line.split puts "Killing #{@browser}, process # #{process[0]}" `kill -9 #{process[0]}` elsif(@browser == SAFARI) line = `ps -A | grep "Safari.app"` process = line.split puts "Killing #{@browser}, process # #{process[0]}" `kill #{process[0]}` end end if(@os == WINDOWS) `TASKKILL /F /IM iexplore.exe /T` if(@browser == IE) `TASKKILL /F /IM firefox.exe /T` if(@browser == FIREFOX) end end I've actually written an app around webrick using threads that a) launches webrick, b) launches the browser of choice and the desired suite of tests, c) waits for the test results (there's a timeout as well), d) writes the test results to an html file, e) kills the browser, f) starts over from b until all suites have been run g) kills webrick I've been meaning to take the time to polish this up and share it back with the group. I'll try to make time sometime in the next few weeks to do so. Jamie On Oct 12, 2005, at 11:28 AM, Luke Closs wrote: Hey, |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | automated testing with browsers: 00036, Luke Closs |
|---|---|
| Next by Date: | Re: automated testing with browsers: 00036, Jamie Orchard-Hays |
| Previous by Thread: | automated testing with browsersi: 00036, Luke Closs |
| Next by Thread: | Re: automated testing with browsers: 00036, Jamie Orchard-Hays |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |