Testng

12 views
Skip to first unread message

rama laxmi

unread,
Jan 16, 2019, 10:43:28 PM1/16/19
to qapl...@googlegroups.com
Hi all,
 
Can anyone help me out with this:

How to get values i.e, test data from Excel file into testng script i.e, @Test method

How to use data provider in testng

Thanks in advance.
Ramalaxmi

sravani reddy Yadla

unread,
Jan 17, 2019, 2:26:52 AM1/17/19
to qapl...@googlegroups.com
@Test
    public void start() {
    String url="https://www.goibibo.com/";
    driver.get(url);
    }
   
    @Test(dependsOnMethods= {"Passengerdetailstest.start"},alwaysRun=true)
    public void fs() {
        FlightSearchPage b =new FlightSearchPage(driver);
        b.roundtripsearch(getdata(f2, "origin"), getdata(f2,"destination"));
        b.journeydates();
        b.passengers();
        b.journeyclass();
       
     }
@Test(dependsOnMethods= {"Passengerdetailstest.fs"},alwaysRun=true)
    public void book() {
        BookingflightPage bk=new BookingflightPage(driver);
       
        bk.booking();
        System.out.println("exit");
        }
   
    //()
    @Test(dataProvider="readdata",dependsOnMethods= {"Passengerdetailstest.book"})
    public void passenger(String title,String givenname,String surname,String dateofbirth,String passport,String country,String Expiry,String visa,String email,String mobile ) {
        System.out.println("passenger");
        Passengerdetails customer= new Passengerdetails(driver);
        System.out.println(title);
        customer.customerdetails( title,givenname,surname,dateofbirth,passport,country, Expiry,visa,email,mobile);
       
    }
    @DataProvider(name="readdata")
    public Object[][] exceldata() {
        Object[][] testArray=gettable(f1, sheetname);
        return testArray;
    }
   

--
You received this message because you are subscribed to the Google Groups "QAPlanet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qaplanet+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rama laxmi

unread,
Jan 17, 2019, 9:29:10 AM1/17/19
to qapl...@googlegroups.com
Thank you!
Reply all
Reply to author
Forward
0 new messages