Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot not getting captured , please help #796

Open
mayankchandel opened this issue Feb 29, 2020 · 1 comment
Open

Screenshot not getting captured , please help #796

mayankchandel opened this issue Feb 29, 2020 · 1 comment

Comments

@mayankchandel
Copy link

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();
	
}

}

@aik099
Copy link
Member

aik099 commented Mar 5, 2020

@mayankchandel , you've posted Java file source code in this task description. The Mink is project written on PHP.

Either you've posted incorrect code OR you've posted to wrong GitHub project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants