Read data from Excel to DataProvider in Selenium

Read data from Excel to DataProvider in Selenium

Krishna Sakinala

7 лет назад

26,114 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@manishmandal6660
@manishmandal6660 - 01.09.2022 13:37

We can read data from Excel by using Apachi POI.

Ответить
@akshk4279
@akshk4279 - 29.06.2021 10:49

Hi Krishna, Can you tell me how to merge two data providers?
@DataProvider
public static Object[][] getStep1TestData()

{
Object data1[][]= TestUtil.getTestData(sheet1);

return data1;
}


@DataProvider
public Object[][] getStep2TestData()

{
Object data2[][]= TestUtil.getTestData(sheet2);
return data2;
}

@DataProvider
public Object[][] mergeData()

{


}

@Test(dataProvider="mergeData")
public void validateStep2Page(String customer, String customertype, String iscontractsigned, String productname,String productamount,String locationname,
String address1,String address2,String city,String state,String postalcode,String county,String country,String daysofservices,String servicebranchcode,
String csvbranchcode,String product,String quantity,String changeorder) throws Exception

{
salescreatecontractstep1Page.addloc1(customer,customertype,iscontractsigned,productname,productamount) ;
salescreatecontractstep2Page.addlocation(locationname, address1, address2, city, state, postalcode, county, country, daysofservices, servicebranchcode, csvbranchcode, product, quantity, changeorder);


}

Ответить
@mzamomahaeng268
@mzamomahaeng268 - 09.12.2020 23:22

thank you

Ответить
@testcp1787
@testcp1787 - 04.11.2020 15:12

hi sir give a ExcelRead data code and share your github link

Ответить
@manojnv06
@manojnv06 - 10.10.2020 12:02

Thanks bro..

Ответить
@ankursharma786
@ankursharma786 - 31.05.2020 23:44

Hello Krishna ,
If we add one more coloumn "Run_Status" and set it as Y. How we will do that ?

Ответить
@saravaneekeerthi1855
@saravaneekeerthi1855 - 07.12.2019 21:06

Sir,your video is very helpful plz could you explain click,double click,and drop down option using through this way means it's very helpful sir

Ответить
@RaviKumar-hz8cf
@RaviKumar-hz8cf - 15.08.2018 15:34

gettting error- the data provider 'userData' returned an empty array or iterator, so this test is not doing anything

Ответить
@vineetnt
@vineetnt - 08.08.2018 22:59

Hi Krishna, In Dataprovider approach , i have noticed that we need to give same number of arguments in the function as the number of columns we have in the excel. Is there an approach in Test dataprovider in which i can only fetch data from few columns ? Suppose my excel has 10 columns and i only want to fetch data from any 3 columns, would it be possible in TestData provider ?

Ответить
@kaeshikerjeyasingh5208
@kaeshikerjeyasingh5208 - 12.07.2018 03:13

Hi Krishna,

Thanks a lot. It is really good and useful... Keep up the Good Work.

Ответить
@ravik3759
@ravik3759 - 18.05.2018 09:55

please provide solution Dataprovider trying to pass one parameter but method takes 3

Ответить
@zeck9265
@zeck9265 - 19.03.2018 09:24

Hi Krishna,
Very good video.
I have one problem. when I write in ExcelAPITest class 'CellTYPE' its giving me compile error, what is solution do i need to import anything?
please Reply
Thanks

Ответить
@kashif3683
@kashif3683 - 07.02.2018 17:14

Hi - Can you please share the getCellData() method code?

Ответить
@RituGurnani_India
@RituGurnani_India - 11.01.2018 20:26

Too good . From basics to advance. Very nice

Ответить
@DuongNguyen-kh6in
@DuongNguyen-kh6in - 17.12.2017 12:16

Hello Krishna. Thanks for your share, it's very helpful.

Ответить
@akshaysharma2841
@akshaysharma2841 - 26.11.2017 15:15

Hello Krishna,

Thanks for the informative videos you have posted. I saw all the excel related videos and while accessing excel through Dataprovider, i copied your code exactly how its shown in the video. But, i am being presented with the following error- "Data provider mismatch". Could you please help me resolve this issue???

Ответить
@bepostive5340
@bepostive5340 - 30.10.2017 11:21

hi Krishna,
your effords was tooo good really greate yar but can u answer my question ?
my question is what is difference between to use reading data from excel dataprovider and apage poi ???what is the difference between poi and dataprovider???

Ответить
@bepostive5340
@bepostive5340 - 20.06.2017 14:34

"ExcelApiTest" got a compileError .what type of jar file required to avoid this error.

Ответить
@sanjayadhakal3400
@sanjayadhakal3400 - 08.06.2017 23:45

Hello sir, from the class"ExcelToDataProvider" the last section where we have"excelData[i-1][j] = eat.getCellData(sheetName, j, i);" i am getting error on eat.getCellData

When i hover over it says "The method getCellData(string int, int) is undefined for the type ExcelApiTest.
Can you please help

Ответить
@ashwiintriivedi9036
@ashwiintriivedi9036 - 16.05.2017 16:09

Hello Krishna Sakinala sir, it would be very helpful if you will please provide the file "ExcelApiTest".

Ответить