Screenshot not getting captured , please help
Open
Nobody has claimed this yet.
response-needed
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 286
- PR merge metrics
- No merged PRs in 30d
Description
package selenimfile;
import java.io.File;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class ScreenshotDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "C:\\Users\\GLB-114\\Downloads\\chromedriver.exe" );
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(50, TimeUnit.SECONDS);
driver.get("https://www.lambdatest.com/");
TakesScreenshot sc= (TakesScreenshot)driver;
File source= sc.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(source, new File("./selenim/screenshot/screen.png"));
System.out.println("screenshot has been taken ");
driver.close();
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ScreenshotDemo.main entry point shown in the issue and inspect the screenshot capture and file-copy steps. Reproduce the run with the provided ChromeDriver setup; done means the program completes and creates the expected screen.png file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100