Posts

Showing posts from December, 2021

How to make batch file in selenium using Maven

 Generate .xml file- 1. Right click on project which you want to execute through batch file 2. Go to TestNG & click on Convert to TestNG 3. One testng.xml file will created in your project 4. Move that file to main-> resources folder 5. Right click on project & Run as Maven Clean & then Maven install          There would be below errors          - Java version is not compatible with compiler           - To change java compiler, Right click on project & go to java build path, then go to java compiler & change java execution environment variable according to error          - Need to add some xmls in Pom.xml after the <version>           <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding...

Execute the selenium script without opening browser.

System.setProperty("webdriver.chrome.driver", "C:\\Users\\Krina Modi\\eclipse-workspace\\chromedriver.exe");                     ChromeOptions options = new ChromeOptions(); options.addArguments("--no-sandbox"); options.addArguments("headless", "window-size=1200,700"); ChromeDriver driver = new ChromeDriver(options);