PART 7 - Cucumber Feature file with Excel Data || Excel Utility || Apache POI API

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • #CucumberLatestVideos #CucumberBDD #NaveenAutomationLabs
    In this video, I have explained how to get the data from excel sheet and use the same data in cucumber feature file.
    Latest code available on GIT repo: github.com/nav...
    We will be designing different components in this Framework:
    1. Feature Files
    2. Step Definition Classes
    3. Configuration Files
    4. Cucumber Hooks with before and after
    5. Element Utilities/Libraries/Generic Functions
    6. Cucumber 6 Extent Report Adaptor for Spark HTML / PDF Reports
    7. Test Runners in JUnit/TestNG
    8. Page Classes for POM
    9. Maven with pom.xml with different dependencies and plugins
    10. Parallel Execution
    11. Cucumber 6 Web HTML Reports
    12. Screenshot for Failure scenarios
    13. Integration with GIT Repo
    14. Running test cases from Jenkins
    15. Running test cases on Dockerized Selenium GRID
    And much more.....
    Technologies Used:
    1. Selenium WebDriver with Java Language binding
    2. Cucumber 6.x JVM library
    3. WebDriverManager
    4. JDK 1.8
    5. Maven (Build tool)
    6. Maven Plugins
    7. Cucumber extent report 6 adapter
    8. JUnit 4.x library / TestNG Cucumber Lib
    9. Log4j
    10. GIT HUB - Git Repo
    11. Docker
    12. Jenkins
    13. Eclipse (IDE)
    14. APACHE POI APIs
    15. Excel Sheet
    ~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
    www.youtube.co...
    Follow me on my Facebook Page:
    / naveenqtpexpert
    Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
    t.me/joinchat/...
    Paid courses (Recorded) videos:
    naveenautomati...
    For Java & Selenium - naveenautomatio...
    For API (Manual + Automation) - naveenautomatio...

КОМЕНТАРІ • 89

  • @naveenautomationlabs
    @naveenautomationlabs  3 роки тому +14

    Latest code available on GIT repo: github.com/naveenanimation20/LatestCucumber6WithPOM

    • @sani4635
      @sani4635 2 роки тому

      Awesome thank you !!!

    • @jsrinivasrao74
      @jsrinivasrao74 2 роки тому

      Naveen , iam getting below error. can you please help me to resolve this
      ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
      When user fills the form from given sheetname "contactus" and rownumber 0 # stepdefinition.ContactUsSteps.user_fills_the_form_from_given_sheetname_and_rownumber(java.lang.String,java.lang.Integer)
      org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been "select" but was "div"
      Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
      System info: host: 'LAPTOP-CK5HNK8F', ip: '192.168.1.145', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '12.0.2'
      Driver info: driver.version: unknown
      at org.openqa.selenium.support.ui.Select.(Select.java:48)
      at com.pages.ContactUsPage.fillContactUsForm(ContactUsPage.java:27)
      at stepdefinition.ContactUsSteps.user_fills_the_form_from_given_sheetname_and_rownumber(ContactUsSteps.java:40)
      at ✽.user fills the form from given sheetname "contactus" and rownumber 0(file:///C:/Users/jsrin/eclipse-workspace/CucumberPOMSeries/src/test/resources/AppFeatures/Contactus.feature:7)
      
      And user clicks on send button # stepdefinition.ContactUsSteps.user_clicks_on_send_button()
      Then it shows a successful message "Your message has been successfully sent to our team." # stepdefinition.ContactUsSteps.it_shows_a_successful_message(java.lang.String)
      Embedding Contact_Us_scenario_with_different_set_of_data [image/png 148419 bytes]

    • @sakthiswarubini4666
      @sakthiswarubini4666 Рік тому

      Thanks Naveen. In my scenario, I wanted to fetch data in runtime, as the data status might be keep on changing in pipeline. So what might be the better solution here. Thanks!

  • @elavarasiperumal1091
    @elavarasiperumal1091 Рік тому +2

    You are the God for my automation work

  • @anjalijha1598
    @anjalijha1598 3 роки тому +3

    This is what I was looking for from long....Thank you so much Naveen.

  • @amaankhan1507
    @amaankhan1507 2 роки тому +1

    This was really helpful. better than most of the other solutions I found elsewhere.

  • @hiloripatel7188
    @hiloripatel7188 3 роки тому +1

    Thankyou Naveen Most awaited topic for cucumber you are simply awesome

  • @AbhijeetLuthra
    @AbhijeetLuthra Місяць тому

    Will this work ?
    Assume if we have too many rows in excel sheet and if we add new test data in between the rows whole index will change for every test data

  • @sravaniyajamanam1329
    @sravaniyajamanam1329 Рік тому +1

    Excellent explanation sir, thanks a lot for the video 😊

  • @harshrajsingh296
    @harshrajsingh296 3 роки тому +2

    What if we have some other scenarios to run after this but test data needs to be same?
    like for single test data some other scenarios are written but I need to run the whole flow with first set of data and then the whole flow with other set of data.
    can you suggest some solution please?

  • @palashchatterjee1454
    @palashchatterjee1454 3 роки тому +1

    Hello Naveen sir,
    Do you have any video for the excel read part which you are using in this video.
    Thanks in adv.

  • @justforyou147
    @justforyou147 29 днів тому

    If my data set has around 50 columns, how do I do it efficiently? Please

  • @tushararora512
    @tushararora512 3 роки тому

    Thank you so much Naveen Sir. We are blessed to have you as a teacher in QA community :)

    • @jsrinivasrao74
      @jsrinivasrao74 2 роки тому

      Tushar, iam getting below error. can you please help me to resolve this
      ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
      When user fills the form from given sheetname "contactus" and rownumber 0 # stepdefinition.ContactUsSteps.user_fills_the_form_from_given_sheetname_and_rownumber(java.lang.String,java.lang.Integer)
      org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been "select" but was "div"
      Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
      System info: host: 'LAPTOP-CK5HNK8F', ip: '192.168.1.145', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '12.0.2'
      Driver info: driver.version: unknown
      at org.openqa.selenium.support.ui.Select.(Select.java:48)
      at com.pages.ContactUsPage.fillContactUsForm(ContactUsPage.java:27)
      at stepdefinition.ContactUsSteps.user_fills_the_form_from_given_sheetname_and_rownumber(ContactUsSteps.java:40)
      at ✽.user fills the form from given sheetname "contactus" and rownumber 0(file:///C:/Users/jsrin/eclipse-workspace/CucumberPOMSeries/src/test/resources/AppFeatures/Contactus.feature:7)
      
      And user clicks on send button # stepdefinition.ContactUsSteps.user_clicks_on_send_button()
      Then it shows a successful message "Your message has been successfully sent to our team." # stepdefinition.ContactUsSteps.it_shows_a_successful_message(java.lang.String)
      Embedding Contact_Us_scenario_with_different_set_of_data [image/png 148419 bytes]

  • @shreyasakpal1362
    @shreyasakpal1362 8 місяців тому

    Hi Naveen ,could you pls provide excel which you are using?

  • @vaishnavi905
    @vaishnavi905 Рік тому

    Hi Naveen, is there a solution if my rows are dynamic. When and Then are dependent in my project, so cannot use a loop in When.

  • @NotiBinodini9900
    @NotiBinodini9900 7 місяців тому

    What about not to run parallelly and one set of data will complete full scenario flow and then browser quit then again browser will open for next user?
    I have tried but getting session id null

  • @tahaa4733
    @tahaa4733 2 роки тому

    Naveen how can we read multiple data without giving pre info. ? Is there any way to achieve it with cucumber-junit ?

  • @SarangHoley
    @SarangHoley 3 роки тому +1

    Thanks for the efforts Naveen for creating this video, much much needed content 👍😊

  • @bloopers2279
    @bloopers2279 2 роки тому

    @naveen can you please help me with one issue when reading data from excel file
    I want to read string data which has space as the last character but when i tried using apache poi and read from cell data it is trimming out the last space in the string. Please give a solution for this

  • @happyhuman9625
    @happyhuman9625 3 роки тому +1

    What to do if they asked to login once and execute test multiple test cases in a single browser?

  • @abhijitkumar8615
    @abhijitkumar8615 3 роки тому

    Adding each rownumber in featurefile to get the data from an excel sheet is not a feasible solution. It would be better if we can iterate through the rows and columns just by adding the columnname only once. Can you suggest a way to do that in cucumber?

  • @akashmazumder12
    @akashmazumder12 2 роки тому

    I am using mac and in excel while sending the date value its getting converted to General, though i have saved in date format but unable to pass as date value . Please help

  • @rebecca3911
    @rebecca3911 2 роки тому

    Using the ExcelReader, but it seems openxml4j dependency cannot be found, also when running it, keeps giving me Error " java.io.IOException: Your InputStream was neither an OLE2 stream, nor an OOXML stream or you haven't provide the poi-ooxml*.jar in the classpath/modulepath - FileMagic: OOXML, having providers: [org.apache.poi.hssf.usermodel.HSSFWorkbookFactory@5e7c141d]" any ideas?? thank you!

  • @harshakumarnomula7829
    @harshakumarnomula7829 Рік тому

    Hi sir ,how can we execute same testcase multiple times with execute column "yes "with different test data

  • @vijayeathakotla366
    @vijayeathakotla366 3 роки тому

    nice video. But I think using a feature parser will be the best option and in that way, we can generate report much informative rather than including row number / sheetname and sheet name

  • @AnonymousAccount514
    @AnonymousAccount514 2 роки тому

    But we still have to know how many records we are going to test....is there anyway we can do this without knowing how many records are going to be in the Excel file?

  • @manishaneharkar2009
    @manishaneharkar2009 3 роки тому

    Hi Naveen..ur all vedios are always very helpful..
    I have one question...can we use two different execls for data in one feature file for same scenario..can u plz ans this

  • @sonalisahani5673
    @sonalisahani5673 3 роки тому +2

    Hi Naveen,Pls start a API automation batch.

  • @rkaravind
    @rkaravind 3 роки тому

    Thank you Naveen for the great content.. Question - Is there any advantage performance wise or space wise if data stored in excel or its just better option for maintenance ?

  • @MananJain-zb6wn
    @MananJain-zb6wn 4 місяці тому

    i am writing two feature file one is for login and another one is from product page . So i copy paste the feature file line from login into product and when i add lines in product feature then says driver is null . can anyone help me

  • @kiranmaikunisetti
    @kiranmaikunisetti Рік тому

    Thanks for the video Naveen, can you please upload a video on how to give range 1-10 like that in examples using retention policy in java as mentioned by you. Please upload naveen, it will be helpful

  • @nusrathafreen7314
    @nusrathafreen7314 Рік тому

    Hi Naveen,
    Thank you for giving us so much knowledge on cucumber.
    Currently I am using cucumber in my current organization where I have the challenge to extract data from Excel, now in my project i have 10 feature files all 10 has different scenarios outline if i want to execute 5 different data to execute all 10 feature files 5 different times how to achieve such type is challenge could you please help me out on this

    • @Theivanag
      @Theivanag Рік тому

      Under one feature file
      How many scenario or scenario outline can be added pls answer..

  • @anjalis2794
    @anjalis2794 3 роки тому

    Thanks for the explanation..
    Can we write the result in excel sheet ??

  • @socialmedia434
    @socialmedia434 3 роки тому +1

    Hi All, can anyone help me, I have captured OrderId from application, now i want to write it in my spark report. How do i do that?

  • @piyaasok
    @piyaasok 2 роки тому

    Hi Sir , is there a way i can take data from a data provider and pass to a feature file. Please help , thanks

  • @shubhamshreyashkr4238
    @shubhamshreyashkr4238 3 роки тому

    Very helpful video..thank your Sir

  • @praveenreddy5537
    @praveenreddy5537 2 роки тому

    Hi Naveen, can we execute scenario based on cell value(Like only required call value rows need to read. All other rows need to skip )

  • @winchin19
    @winchin19 2 роки тому +1

    Is there a way to read the whole excel rows without calling from feature file one by one? Bcz if there are a thousand of records in an excel file. We have to right all the rows in the feature file! Thank you.

    • @tahaa4733
      @tahaa4733 2 роки тому +1

      I m curious about the same thing, I heard QMetry can do that but couldn't find any useful info about this tool

    • @winchin19
      @winchin19 2 роки тому

      @@tahaa4733 It seems like QMetry is a great test management tool. Thank you very much for mentioning it.

  • @vallalarasupandiyan3464
    @vallalarasupandiyan3464 Рік тому

    Thats a good one..
    1) Is it possible to write data too in the excel by fetching the value from Application?
    2) Is it possible to update the data table with the values read from application during runtime?
    #NaveenAutomationLabs

    • @funguyz123
      @funguyz123 Рік тому

      Did you get any solution for writting to excel?

  • @hariprasad984
    @hariprasad984 3 роки тому

    Can we create parallel run for the script in this video??

  • @muhammadannusdhobal4938
    @muhammadannusdhobal4938 2 роки тому

    Hi Naveen, Could you please attach the excel sheet? It will help to understand more.

  • @hariaharand4354
    @hariaharand4354 21 день тому

    bro when using ur code for csv file facing following error can you please give ant alternate idea for read data from csv file
    org.apache.poi.poifs.filesystem.NotOLE2FileException: Invalid header signature; read 0x7974696C69636146, expected 0xE11AB1A1E011CFD0 - Your file appears not to be a valid OLE2 document

  • @krishnarohit7546
    @krishnarohit7546 3 роки тому

    Thanks a lot!sir I have tried working on same type of concept I'm getting classnotfound exception can you please help me out

  • @bharamanidukare8727
    @bharamanidukare8727 Рік тому

    Hello Naveen sir, Could you please share the CSV format Utility code using java selenium

  • @hariprasad984
    @hariprasad984 3 роки тому

    How to pass the created object contactUsPage to another step definition file , because a common step is available only in another stepdefinition file

  • @archanabr441
    @archanabr441 2 роки тому

    Hi Sir, Thanks for the great Information. But, how to test for different locales (localization testing) in cucumber, where expected and actual data will vary?

  • @soumyajoshi4668
    @soumyajoshi4668 3 роки тому

    Nice explanation sir but where we get link of your git repo?

  • @NilimaPuraneVlogs
    @NilimaPuraneVlogs 3 роки тому

    @Naveen I tried code but getting error java.io.FileNotFoundException: \Users
    ilima.purane\Desktop\automation.xlsx...filepath is correct though still..can you please guide

  • @VivienceHoang
    @VivienceHoang 2 роки тому

    Hi there, thanks for your idea, but should we apply the solution when the excel file has thousands of rows, it means "RowNumber" is listed out from 0 to a certain thousand number?

  • @shashikantchourasia1402
    @shashikantchourasia1402 2 роки тому

    Hi Naveen.
    Let's say if the excel sheet have 100 data. Do we have to write it 100 times in feature file ?

  • @monalishadash5021
    @monalishadash5021 2 роки тому

    @Naveen , How do we handle the case where there are 100/500/1000 numbers of testdata in excel? Do we add those many row# in feature file? Also I want the excel file to be an input to the suite without any change in code. How can this be handled using BDD. Please reply

  • @vyasmayur751
    @vyasmayur751 3 роки тому

    Great video. Please make video on Robot framework with Python and it's future.

  • @pratyushamrutwani363
    @pratyushamrutwani363 3 роки тому

    Shandar zabardast zindabad

  • @pramilav4229
    @pramilav4229 3 роки тому

    Hi Naveen
    I'm having doubt in how to read data from Excel sheet for same scenario with different inputs in scenario outline

  • @heena.rahang6017
    @heena.rahang6017 3 роки тому

    Hello Naveen, What if we have 100 rows , is there any way to tackle this without Examples.Please help.

    • @AbhijeetLuthra
      @AbhijeetLuthra Місяць тому

      m looking for same did u find any way ?

  • @tulasiramsunkara
    @tulasiramsunkara 3 роки тому

    Great to see this content.👌👌👌

  • @vijaybadgujar5576
    @vijaybadgujar5576 2 роки тому

    How can I get the entire tutorial link?

  • @mt3616
    @mt3616 3 роки тому

    Thanks Naveen for this video .

  • @GOVINDSMIT
    @GOVINDSMIT 3 роки тому

    Please make a video on how to convert a excel file into cucumber data table just pass the excel file in features file then do some logic and convert that excel file into data tables.
    Thanks and any help will be appreciated.

  • @pandudamera7211
    @pandudamera7211 3 роки тому

    Great explanation sir

  • @indukeerthi
    @indukeerthi 3 роки тому

    Thanks a lot for this video! It's really helpful for me!

  • @shaikmuneer5909
    @shaikmuneer5909 3 роки тому

    Can you please share the How to generate excel reports like extent report in cucumber.

  • @shuklanikhil
    @shuklanikhil 3 роки тому

    Superb 👍

  • @karthikraja750
    @karthikraja750 3 роки тому

    @naveen how to proceed with feature file if we have 1000’s of row data in excel? Do you have any other idea or concepts?

  • @JustAnotherPuja
    @JustAnotherPuja 3 роки тому

    Hello sir, can you please do the same tutorial for writing the data into the excel sheet , thank you

  • @janardhanMaidarkar
    @janardhanMaidarkar 3 роки тому +1

    Love you sir..

  • @pratyushamrutwani363
    @pratyushamrutwani363 3 роки тому

    Please guide how to move to DevOps from selenium tester profile

  • @sasivinodakula2134
    @sasivinodakula2134 3 роки тому

    Great Naveen 👍

  • @sindran126
    @sindran126 3 роки тому

    Make a video for Exceptioninintializer error in cuckumber framework

  • @AratiKhandelwal
    @AratiKhandelwal 3 роки тому

    Thank you so much!

  • @amitmalik7804
    @amitmalik7804 2 роки тому

    Waiting for better approach..

  • @hariprasad984
    @hariprasad984 3 роки тому

    How do I run parallel execution by getting data from Excel. My data is overridden