Posts

Showing posts with the label testng

Behaviour of dataprovider when one of the row is failed to process in @test method

Image
Clash Royale CLAN TAG #URR8PPP Behaviour of dataprovider when one of the row is failed to process in @test method I'm new to test ng framework. I'm planning to use data provider to pass the list of form values from the excel sheet. Let's say add product from the list in excel sheet. The @test method will run for each row from the excel sheet when I use data provider? What happens when one of the row failed to process? Does it run the rest of the rows after this failure? Do I have to re-initiate the selenium webdriver and login method again when it fails? I do not want to re initiate the webdriver for each failure.. My current application will retain the session even when the browser closes By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Error while executing Selenium script - java.lang.NullPointerException - TestNG

Image
Clash Royale CLAN TAG #URR8PPP Error while executing Selenium script - java.lang.NullPointerException - TestNG I'm trying to run a script via testNG. But getting java.lang.NullPointerException. I have put in the driver initialisation code in BeforeMethod and rest of the code under Test. Please let me know what's wrong in my script due which Im getting the error.Thanks in Advance. My Script: public class NewTest { WebDriver driver = null; @BeforeMethod public void beforeMethod() { System.setProperty("webdriver.chrome.driver", Constants.Chrome_Driver); WebDriver driver = new ChromeDriver(); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.get("http://" + Constants.auth_Username + ":" + Constants.auth_Password + "@" + Constants.URL); } @Test public void f() throws InterruptedException { actions.Adm...