How to Run Cucumber Test as Maven Test

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024
  • In this video we will discuss How to Run Cucumber Test as Maven Test and generate default reports as well.
    ~-~~-~~~-~~-~
    Please watch: "How To Create Maven build For Selenium Framework"
    • How To Create Maven bu...
    ~-~~-~~~-~~-~

ความคิดเห็น • 91

  • @cjm2005
    @cjm2005 7 ปีที่แล้ว

    Thank you very much for uploading this mate. I've been trying to get my cucumber project running from the command line for the past few days. This video sorted it.

  • @sivaranjanib9162
    @sivaranjanib9162 7 หลายเดือนก่อน +1

    Thanks Mukesh for this concept video, it greatly helped in executing test case via adding include
    with Runner file in plugin to pickup testcase Execution where initially i got only built 100% and no class to run issue

  • @TheMinderEngineer
    @TheMinderEngineer 6 ปีที่แล้ว +1

    Always love hearing perspectives of other entrepreneurs, keep up the hustle! 🚀

    • @Mukeshotwani
      @Mukeshotwani  6 ปีที่แล้ว

      Thanks Nick :) Nice to see your comment.

  • @suryakumaresan1069
    @suryakumaresan1069 6 ปีที่แล้ว +1

    Super buddy. Excellent work. Thanks a lot. U r the only one provided exactly how to run tcs in maven

  • @raghunandanmundada645
    @raghunandanmundada645 5 ปีที่แล้ว +2

    Thanks @Mukesh otwani for good video.
    1. This Solution works, if Runner.java class file is present in src/test/java folder of Maven Project. It doesn't detect, if Java file is present inside src/main/java folder.
    2. It needs to be tag withing . And NOT :

    **/*RunnerNew.java

    • @rashmi6611
      @rashmi6611 4 ปีที่แล้ว

      Thanks, this helped...

  • @DeepakVishwakarma-uv4yr
    @DeepakVishwakarma-uv4yr 4 ปีที่แล้ว +2

    Thank you Thank you so much sir.. Really helpful.

    • @Mukeshotwani
      @Mukeshotwani  4 ปีที่แล้ว

      You are most welcome Deepak.

  • @supriyassampath1419
    @supriyassampath1419 3 ปีที่แล้ว

    Thank you so much for this video.
    I wanted to know where all we can use abstraction in selenium while building a framework

  • @amlam5685
    @amlam5685 4 ปีที่แล้ว

    glad that I found ur video thank you sir , u got a new subscriber,

  • @ankitanag6753
    @ankitanag6753 5 ปีที่แล้ว +1

    Hi Mukesh, thanks for the video. I have a query here which is not related to topic. I am trying to automate an ecommerce website. And wanted to know how do we validate search functionality of such sites which are dynamic..how can I validate the number of records coming for particular filter is correct. How can I validate if I search for mobile and say there comes 70000 items in resultset.how will I validate each item to see if it is a mobile. Please direct..I am new to selenium. facing problems in practical scenarios.

  • @Od3o_ela_sabil_rabek
    @Od3o_ela_sabil_rabek 2 ปีที่แล้ว +1

    Man you're amazing thank you

    • @Mukeshotwani
      @Mukeshotwani  2 ปีที่แล้ว +1

      Happy to help! Thanks Mate

  • @souravghosh5212
    @souravghosh5212 7 ปีที่แล้ว

    nice tutorial...really helpful...can you share a video with gradle dependencies with Cucumber and selenium ?

  • @robertdeboer5309
    @robertdeboer5309 8 ปีที่แล้ว

    Hello Mukesh, I got a question for you doe you know how i can run my test cross browsing? thank you

  • @TANVEERKHAN07
    @TANVEERKHAN07 7 ปีที่แล้ว

    Hi Mukesh,
    looking forward for tutorials on protractor tool. please update on this.

  • @tejavallu3832
    @tejavallu3832 7 ปีที่แล้ว

    Hi Mukesh,
    Your tutorials are very helpful,Thank you so much for your posts.
    I am getting an error.Can you please help me
    What does the red exclamation point icon in Eclipse mean?
    How to solve this issue?

  • @GoldenApples_
    @GoldenApples_ 7 ปีที่แล้ว

    Thanku for the video! can you also mention the link in which the driver is dynamic as I could nt find it?

  • @swethachandra3522
    @swethachandra3522 3 ปีที่แล้ว +1

    Thanks Mukesh .

    • @Mukeshotwani
      @Mukeshotwani  3 ปีที่แล้ว

      Welcome Swetha, Keep learning.

  • @MrSWAPNIL25
    @MrSWAPNIL25 7 ปีที่แล้ว

    Hi Mukesh.. I saw all these videos..it's really helpful for all of us..
    Thanks for that..
    In some video u said u will add another videos which will open browser dynamicall,Also to fetch data from externaly....but still u didn't added those video..
    Waiting for those video..
    Thanks once again..

    • @Mukeshotwani
      @Mukeshotwani  7 ปีที่แล้ว +1

      Hi Swapnil, I have to add will do soon.

  • @MuraliKrishna-ng2ul
    @MuraliKrishna-ng2ul 6 ปีที่แล้ว

    Hi Mukesh. Can you please show us how to run the cucumber tests by using tags through maven goals in Run configurations. And also please show us how to set the same maven goals in Jenkins. I didnt find any usefull turorials in youtube regarding this.

  • @swadhatripathi9623
    @swadhatripathi9623 8 ปีที่แล้ว

    Hi Mukesh, Thanks for sharing video.
    Could you please share plugin used here to run cucumber with maven or else please let me know where i can find it. Thanks.

    • @Mukeshotwani
      @Mukeshotwani  8 ปีที่แล้ว

      Yes here you go learn-automation.com/selenium-maven-build-and-usage/

  • @ulissesdasilva1314
    @ulissesdasilva1314 3 ปีที่แล้ว +1

    Hi Thanks for the videos. Cold you make a video on cross-browser testings

    • @Mukeshotwani
      @Mukeshotwani  3 ปีที่แล้ว

      Hi Ulisses, sure will try to make video on this.

  • @touch2mepraveen
    @touch2mepraveen 7 ปีที่แล้ว +1

    Hi Mukesh,
    Thanks for these amazing videos, I learned cucumber quickly. please add video for Data-driven testing from Xls file and cross browsers testing.
    Thanks

    • @Mukeshotwani
      @Mukeshotwani  7 ปีที่แล้ว +1

      Sure Praveen will do that as of now below link will guide you the same
      www.seleniumframework.com/cucumber-jvm-3/data-driven-framework-with-excel/

    • @touch2mepraveen
      @touch2mepraveen 7 ปีที่แล้ว

      Ya i gone through with this video but i think m not able to make it working for multi browser..so if u create it would be gr8 help.

  • @manjulas3454
    @manjulas3454 3 ปีที่แล้ว

    HI Mukesh, how do I debug my cucumber maven tests in IDE? I mean not the JUnit tests but cucumber maven tests that will have cucumber tags. I have applied breakpoints but unable to run

  • @markimationotaku44
    @markimationotaku44 7 ปีที่แล้ว +1

    Hi Mukesh,
    I'm having issues with the Maven compiler plugin.
    I keep getting this error message that relates to all = driver.switchTo().frame(driver.findElement(By.id("1")));
    [ERROR] **/crm/Cases.java:[135,34] reference to frame is ambiguous
    Do you know anyway around this, Any Suggestions?

    • @Mukeshotwani
      @Mukeshotwani  7 ปีที่แล้ว

      Hi Mark,
      Any sample application for this? Code?

  • @kalshyam82
    @kalshyam82 8 ปีที่แล้ว

    My Requirement is to run scripts based on the tag. for example
    Smoke scripts @Smoke for every build
    @Night for Night execution
    @Regression for regression scripts
    I have created different jobs (Smoke, Night and Regression) in Jenkins and have created seperate runner Java files in the project.
    How can I configure them in POM to ensure only specific tag(ex:smoke) is executed?

  • @sundayjeremiah4711
    @sundayjeremiah4711 7 ปีที่แล้ว

    Hello Mukesh, You did say if showing us how to pass the browser needed from the feature file. If you have done the video, could you please share the link? Thanks

  • @nageenashaik8166
    @nageenashaik8166 4 ปีที่แล้ว +1

    Hi mukesh, I am trying to add compiler and surefire plugin... But in configuration we have to give runner class, in this when I am giving includes line.... It is showing error... Can you please tell... Why??

    • @Mukeshotwani
      @Mukeshotwani  3 ปีที่แล้ว

      Hey Nageena can you share more details along with screenshot?

  • @rupeshkumargupta2824
    @rupeshkumargupta2824 3 ปีที่แล้ว +1

    Hi Mukesh..I have multiple runner file in one folder and I want to run only one runner file....could you please let me know how to do it...
    Appreciate your reply

    • @Mukeshotwani
      @Mukeshotwani  3 ปีที่แล้ว

      Hey Rupesh, in pom.xml file you can configure using maven surefire plugin.

    • @rupeshkumargupta2824
      @rupeshkumargupta2824 3 ปีที่แล้ว

      @@Mukeshotwani Thank you for your much needed reply....
      Kindly provide me if you have any sample code link...

  • @emailtask7383
    @emailtask7383 5 ปีที่แล้ว +1

    Sir, Please make a video using Cucumber with Junit for Extent Report for each step

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว

      Sure mate I will upload soon

  • @rajendramahapatra3293
    @rajendramahapatra3293 5 ปีที่แล้ว

    Hi Mukesh, Could you please upload a video Cucumber with TestNG?

  • @vidyasinha779
    @vidyasinha779 7 ปีที่แล้ว +1

    Hi Mukesh,
    How to pass Browser name as parameter in Cucumber...

    • @Mukeshotwani
      @Mukeshotwani  7 ปีที่แล้ว

      Vidya here is your answer th-cam.com/video/bo46D8uHXTs/w-d-xo.html

  • @madhusudanjayasimha82
    @madhusudanjayasimha82 6 ปีที่แล้ว

    Hi Mukesh, Could you please let me know how to run multiple feature files in required order. Thanks in advance.

  • @nikhilkanojia1683
    @nikhilkanojia1683 8 ปีที่แล้ว +1

    Hi Mukesh,
    I got the following error:
    [ERROR] /D:/workspace1/test/src/main/java/cucumber/steps/PayTickets.java:[6,28] package cucumber.api.java.en does not exist
    [ERROR] /D:/workspace1/test/src/main/java/cucumber/steps/PayTickets.java:[10,10] cannot find symbol
    symbol: class Given
    I even configured the jar file in the classpath, but it didnt work .Any suggestions

    • @Mukeshotwani
      @Mukeshotwani  8 ปีที่แล้ว

      Please use maven only

    • @nikhilkanojia1683
      @nikhilkanojia1683 7 ปีที่แล้ว

      but i want to use maven and cucumber both

    • @raghunandanmundada645
      @raghunandanmundada645 5 ปีที่แล้ว +1

      @Nikhil Kanojia
      Please check you have mentioned all cucumber dependencies in pom.xml. Remove tag if present. Build your project and try.

  • @sireeshareddysanepalli3536
    @sireeshareddysanepalli3536 7 ปีที่แล้ว

    Hi Mukesh,
    I am learning cucumber. now i am trying cucumber with maven. i m getting one error. i m not able to solve that one. can u plz clarify that one.
    my error is :
    Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project com.cucumber.selenium: Exception in provider:

  • @sonalisarkar3517
    @sonalisarkar3517 5 ปีที่แล้ว +1

    I am getting "No test to run" instead of giving all configuration properly. Can you please help me?

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว

      Hi Sonali, it mean some issue in pom.xml which should trigger your cucumber test. Can you share your pom.xml file?

    • @raghunandanmundada645
      @raghunandanmundada645 5 ปีที่แล้ว +3

      @@Mukeshotwani 1. This Solution works, if Runner.java class file is present in src/test/java folder of Maven Project. It doesn't detect, if Java file is present inside src/main/java folder.
      2. It needs to be tag withing . And NOT :

      **/*RunnerNew.java

  • @FayyazeEbrahim
    @FayyazeEbrahim 4 ปีที่แล้ว +1

    Thanks Bro!

  • @prakashgarur4066
    @prakashgarur4066 6 ปีที่แล้ว

    Hi Mukesh,
    I followed your video, but on execution using maven, tests are not getting picked.
    seeing below message in console. Could please suggest how to resolve this.
    Tests run : 0

    • @PankajSharma-pl3nq
      @PankajSharma-pl3nq 6 ปีที่แล้ว

      Facing same issue. Did you get any resolution?

  • @anton7887
    @anton7887 8 ปีที่แล้ว

    How can I run maven on inteliji IDEA? I don't have such an option.

    • @raghunandanmundada645
      @raghunandanmundada645 5 ปีที่แล้ว +1

      @Anton
      No way to directly run pom.xml through IntelliJ IDE.
      So in IntelliJ, open TestRunner.java and Go to Menu Run > Click Run
      .
      Or Open Command Prompt. Go to Project path. Run Command: mvn install

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว

      Thanks Raghu

  • @balasubramanian7903
    @balasubramanian7903 7 ปีที่แล้ว

    Hi Mukesh,
    i am trying cucumber with maven. i m getting error as follow
    "[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project mavan_cucumber: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.

    • @KnightTraders
      @KnightTraders 7 ปีที่แล้ว

      how did you fixed the issue? I'm getting the same issue now.

  • @s1ma_16
    @s1ma_16 3 ปีที่แล้ว

    Thanks

  • @ashikalimaner
    @ashikalimaner 7 ปีที่แล้ว

    Hi Mukesh,
    My requirement is that i am keeping my step Definition code in other Java Project and my runner class is in other java project..
    I am not able to call step definition provided in other java project..
    Please help how can i achieve the same?

    • @Mukeshotwani
      @Mukeshotwani  7 ปีที่แล้ว

      Hi Ashikali,
      I have not tried this because I did not get this kind of requirement so no idea.

    • @ashikalimaner
      @ashikalimaner 7 ปีที่แล้ว

      Mukesh otwani Thanks for replying... I got solution for that... U need to add runner class project to step definition build path... Issue get resolves...

  • @premdev1991
    @premdev1991 6 ปีที่แล้ว +1

    Hi mukesh, In maven pom.xml we are using **/*runnerNew.java , but we've to use to add the test right?

    • @RAJEEVBU
      @RAJEEVBU 5 ปีที่แล้ว +1

      We should use **/*Runner.java

  • @jeremiepayet5979
    @jeremiepayet5979 ปีที่แล้ว +1

    That's the one

  • @GoQuality
    @GoQuality 8 ปีที่แล้ว

    no compiler provided in this environment. perhaps you are running on JRE rather than a JDK
    @mukesh am getting above error

    • @GoQuality
      @GoQuality 8 ปีที่แล้ว

      while running pom.XML after writing build code

    • @Mukeshotwani
      @Mukeshotwani  8 ปีที่แล้ว +1

      learn-automation.com/maven-no-compiler-is-provided-in-this-environment-selenium/

  • @siddzful
    @siddzful 8 ปีที่แล้ว +2

    ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:testCompile (default-testCompile) on project com.learnautomation.cucumber: Compilation failure
    [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
    [ERROR] -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

    • @Mukeshotwani
      @Mukeshotwani  8 ปีที่แล้ว +2

      Yes its known issue kindly follow below link learn-automation.com/maven-no-compiler-is-provided-in-this-environment-selenium/

    • @otariglonti3651
      @otariglonti3651 6 ปีที่แล้ว

      thanks a lot! it was the solution for my problem as well.

  • @satyavenibommakanti9689
    @satyavenibommakanti9689 6 ปีที่แล้ว

    Hi Mukesh, I have followed same steps which you have mentioned in your tutorial and got below error and not able to proceed further, can you pls let me know the issue and help me to resolve the issue[INFO] Scanning for projects...
    [INFO]
    [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building com.learnautomation.cucumber 0.0.1-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ com.learnautomation.cucumber ---
    [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] Copying 0 resource
    [INFO]
    [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ com.learnautomation.cucumber ---
    [INFO] Changes detected - recompiling the module!
    [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
    [INFO] Compiling 4 source files to C:\Users\IBM_ADMIN\workspace\com.learnautomation.cucumber\target\classes
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner3.java:[3,24] package org.junit.runner does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner3.java:[5,26] package cucumber.api.junit does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner3.java:[7,2] cannot find symbol
    symbol: class RunWith
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner2.java:[3,24] package org.junit.runner does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner2.java:[5,26] package cucumber.api.junit does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner2.java:[7,2] cannot find symbol
    symbol: class RunWith
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner1.java:[3,24] package org.junit.runner does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner1.java:[5,26] package cucumber.api.junit does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner1.java:[7,2] cannot find symbol
    symbol: class RunWith
    [INFO] 9 errors
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.483 s
    [INFO] Finished at: 2018-05-21T16:43:39+05:30
    [INFO] Final Memory: 19M/170M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project com.learnautomation.cucumber: Compilation failure: Compilation failure:
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner3.java:[3,24] package org.junit.runner does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner3.java:[5,26] package cucumber.api.junit does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner3.java:[7,2] cannot find symbol
    [ERROR] symbol: class RunWith
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner2.java:[3,24] package org.junit.runner does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner2.java:[5,26] package cucumber.api.junit does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner2.java:[7,2] cannot find symbol
    [ERROR] symbol: class RunWith
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner1.java:[3,24] package org.junit.runner does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner1.java:[5,26] package cucumber.api.junit does not exist
    [ERROR] /C:/Users/IBM_ADMIN/workspace/com.learnautomation.cucumber/src/main/java/Runner/TestRunner1.java:[7,2] cannot find symbol
    [ERROR] symbol: class RunWith
    [ERROR] -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

  • @goutammalakar2451
    @goutammalakar2451 5 ปีที่แล้ว

    1 Scenarios ([32m1 passed[0m)
    11 Steps ([32m11 passed[0m)
    2m50.733s
    Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 172.278 sec - in com.centurylink.ecommerce.runner.RunnerClassTest
    Results :
    Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
    Why I am getting Tests run: 0, even I have successfully executed my script???

    • @raghunandanmundada645
      @raghunandanmundada645 5 ปีที่แล้ว +2

      @Goutam Malakar
      This Solution works, if Runner.java class file is present in src/test/java folder of Maven Project. It doesn't detect if Java file is present inside src/main/java folder.

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว +1

      Correct Raghu because maven surefire plugin works in test phas of project.

  • @towhidskynet
    @towhidskynet 7 ปีที่แล้ว

    9.06

  • @oscardanielmarin6506
    @oscardanielmarin6506 5 ปีที่แล้ว +1

    Please Help------>When execute maven test
    [INFO] -------------------------------------------------------
    [INFO] T E S T S
    [INFO] -------------------------------------------------------
    [INFO]
    [INFO] Results:
    [INFO]
    [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว

      PLease share pom.xml file it seems maven is not able to find test runner

    • @raghunandanmundada645
      @raghunandanmundada645 5 ปีที่แล้ว

      @Oscar Daniel Marin
      This Solution works, if Runner.java class file is present in src/test/java folder of Maven Project. It doesn't detect, if Java file is present inside src/main/java folder.