4
Can anyone tell me if it is possible to access the page without opening a browser? That is, do the tests without opening the browser.
Is there any way? If there’s a light.
I’m using the Firefox browser
4
Can anyone tell me if it is possible to access the page without opening a browser? That is, do the tests without opening the browser.
Is there any way? If there’s a light.
I’m using the Firefox browser
3
Yes. Enough install Phantomjs.
Then you change the webdrive from:
driver = webdriver.Firefox()
for:
driver = webdriver.PhantomJS()
The rest of the code I believe you will not need to change.
1
There’s a simple way to solve this problem... Just replace the default Webdriver creation
Of:
WebDriver driver = new ChromeDriver();
To:
ChromeOptions options = new ChromeOptions();
options.setHeadless(true);
WebDriver driver = new ChromeDriver(options);
Simple like this, I hope I helped! See you later!
Browser other questions tagged java selenium selenium-webdriver
You are not signed in. Login or sign up in order to post.
Perfect, but it works in JAVA right? and I’ll have to use another browser?
– Thiago Costa
@Thiagocosta he is another browser, only without interface... does everything in background.
– Luiz Carvalho
To complement: depending on the complexity of the test, some care should be taken with phantonjs, it does not accept downloading files like any other common browser and neither runs nor even recognizes the flash. Yes, they are stupid limitations, but to test the availability of a link download or check if such a frame containing a flash element loaded without errors, phantonjs can not do this job.
– Striter Alfa
@Thiagocosta works in Java yes.
– Luiz Carvalho