selenium能测java程序吗,使用Java中的selenium驱动程序进行测试,无需打开任何浏览器...

I need to test with selenium chrome driver in Java. But chrome window should't be opened. Assume this a product and no window should be opened.

I've also looked at this one ;

Is it possible to hide the browser in Selenium RC?

But no solution for me. The testing should be operating system independent and I've tried HtmlUnitDriver for testing without opening any window but it has some problem. When there is finding components by id, it may not find the component by id. Some servers may send the component id according to browser and I can't know what id I should use to test.

Because of that I'm trying to use chrome driver.

Is there a way to use chromedriver without opening chrome window or another way to test without opening any window with Selenium in Java?

Thank!

解决方案

Go with PhantomJS but if running them in chromedriver is required and you have the resources, this blog has a good recipe on running headless selenium with chrome. Requiring you to download the following...

VirtualBox

Vagrant

NodeJS

If you plan to implement Jenkins or any other CI in the future, I strongly suggest going with PhantomJS though.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值