Selenium WebDriver operates very slow

0 votes

I am using Selenium WebDriver to take the screenshot of web pages. the time I hit run in eclipse to the time the screenshot shows up in my local drive is 7-10 seconds. There is a delay in the launching of Firefox.

Below is my Code:

WebDriver driver = new FirefoxDriver();
driver.get("http://www.cnn.com");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("c:\\test\\screenshot.png"));

How to speed up the execution process?

Aug 24, 2018 in Selenium by darklord
• 6,190 points
690 views

1 answer to this question.

0 votes

Allowing WebDriver to attach to a running browser - this has been an issue for years. Till now this feature has still not been added. As far as I am aware, there is no way to make Firefox load any faster. You can try a few other tricks though.

fp.setPreference("webdriver.load.strategy", "unstable")
answered Aug 24, 2018 by Meci Matt
• 9,440 points

Related Questions In Selenium

0 votes
3 answers

How to specify "ENTER" button functionality in Selenium WebDriver code?

using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); ...READ MORE

answered Feb 12 in Selenium by anonymous
12,763 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

I tried to open a new website when a new tab is opened using Selenium Webdriver

Try this code: ArrayList<String> tabs = new ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,110 points
1,153 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
1,175 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,150 points
1,261 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,150 points
1,017 views
0 votes
1 answer

Selenium WebDriver typing speed is slow in input text field

It worked for me in the 64bit ...READ MORE

answered Jun 1, 2018 in Selenium by Meci Matt
• 9,440 points
3,370 views