Skip to main content

Posts

Showing posts from November, 2020

Capturing the screenshot via selenium

     We are discussing here about capturing a Screenshot via selenium, we have taken an example of FB page where if the title of FB page is different from what we have expected, then the screenshot should be captured Below is code for your understanding ...... import org.testng.annotations.Test; import java.io.File; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Screenshotss { WebDriver driver ; @Test public void test() throws IOException {     System.setProperty( "Webdriver.chrome.driver" , "chromedriver" ); WebDriver driver = new ChromeDriver(); driver .manage().timeouts().implicitlyWait(5, TimeUnit. SECONDS ); //opening a facebook link     driver .get( "https://www.facebook.com" ); ...

Mac OS- Error - eclipse (JVM) while updating Catalina to Big Sur

  Hi, As you have received your new OS update Big Sur 11 from Catalina 10  You might be facing issue of eclipse throwing an error "failed to create Java virtual machine". This a bug already reported to the community and you will find many confusing solution to fix the issue I'll explain you in simple steps how to fix this issue. Press keys (command_shift+G) make sure while pressing these buttons your mouse is pointing on desktop   Go to folder, A window will open  where you have to enter. " /Library/Java/JavaVirtualMachines " and press Go it will take you the version installed of JDK in your machine in my case it is jdk1.8.0_241.jdk shown as below you need to find the eclipse installed in your system it can be under application(which can be found in Finder) in my case it was present in home directory under software folder   click on eclipse and go to "show package contents"  Open "contents" folder check the file "info.pilst". open ...

Automating Flipkart via selenium

                                            Hi Folks, we are automating a flipkart site where you will see how to search and filter the product you choose without logging in . import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.Select; import org.testng.annotations.Test; public class flipkart { WebDriver driver ; @Test       public void test()       {   System.setProperty( "Webdriver.chrome.driver" , "chromedriver" );     WebDriver driver = new ChromeDriver();   driver .manage().timeouts().implicitlyWait(5, TimeUnit. SECONDS );   driver .manage().window().maximize();          driver .get( "https://www.flipkart.com" );   ...