dimanche 6 janvier 2019

While using TestNG if we define WebDriver driver; globally then without creating object of that class how we are able to use driver under a method?

The code is working fine but why ?? without creating object of class Testing123 how we are able to access that driver ??

public class Testing123 {
                    WebDriver driver ;

                    @Test
                    public void test1() {
                             driver = new ChromeDriver();
                             driver.get("http://google.com");
                                        }
                    }

Aucun commentaire:

Enregistrer un commentaire