简体   繁体   中英

Headless in Windows 7 for Ruby in Watir?

I am new here. Is there any way to use headless in windows? I tried but it says :

:/Ruby193/lib/ruby/gems/1.9.1/gems/headless-1.0.1/lib/headless/cli_util.rb:4:in ``': No such file or directory - which Xvfb (Errno::ENOENT)

Please help...

Headless Tests in "WINDOWS7" using WATIR ? You can use phantomjs which is super easy to configure. Follow these easy steps:

  1. Download phantomjs from here
  2. Extract to desired folder, once extracted you just need phantomjs.exe
  3. Now where ever you instantiating the browser, use it like this:

     phantom_dir = "location of phantomjs.exe" ENV['PATH'] = "#{ENV['PATH']}#{File::PATH_SEPARATOR}#{ghost_dir}" browser = Watir::Browser.new :"phantomjs" 

To run headless on other OS follow easy steps here

You have to run it on a linux box. Xvfb doesn't exist in Windows or Mac

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM