protractor with any headless browser?

后端 未结 2 384
星月不相逢
星月不相逢 2020-12-18 08:41

I am using protractor and it works when I specify chrome as the browsertype. I am looking for a headless browser sample code, I have looked for phantomJs but I could not run

2条回答
  •  被撕碎了的回忆
    2020-12-18 09:17

    No other headless browser out there besides PhantomJS while the latter is a dead-end with Protractor.

    You can try docker-selenium or, if you don't like Docker you can do it yourself with ubuntu-headless sample. Both solutions provide Chrome & Firefox by using Xvfb even though there is no real DISPLAY.

    UPDATE 2 Seems to be possible to run Xvfb in OSX: http://xquartz.macosforge.org/landing/

    UPDATE 1 Mac OSX selenium headless solution:

    Enable multi-user remote desktop access to OSX machine

    So can test selenium headless on mac. Not headless really but as another user so it doesn't interfere with your current user display. To do this you need kickstart: http://support.apple.com/en-us/HT201710 Begin using the kickstart utility

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
    

    Activate Remote Desktop Sharing, enable access privileges for all users and restart ARD Agent:

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all 
    
    Apple Remote Desktop 3.2 or later only

    Allow access for all users and give all users full access

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all
    

    Kickstart help command

    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -help
    

提交回复
热议问题