How to create Runnable JAR File from Selenium Project || Executable JAR file

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 127

  • @kannathasanelangovan2710
    @kannathasanelangovan2710 5 лет назад +9

    Thank you so much naveen for all your videos.Personally it's helping me a lot. I have questions to this video What about the report? Where can I see what are all the test cases passed after running this JAR file?

  • @muralikrishna8327
    @muralikrishna8327 5 лет назад +5

    Hi Naveen, thank you so much for sharing lot of knowledge on Automation skills
    But I have a query how to implement this feature for Cucumber frame work ?
    Query :
    How run test cases written in Cucumber frame work by using this executable jars?

  • @abhisekbanerjee3369
    @abhisekbanerjee3369 4 года назад +1

    I will remain forever grateful to Naveen sir for the videos. It helped me immensely.

  • @sijijaison2282
    @sijijaison2282 4 года назад +2

    Hi Naveen. Thanks for this informative video.How can we implement this with Junit + Cucumber + Maven based project ? In junit runner class we need to create main method and we need to call the stepdefintion classes?

  • @sunildewna8165
    @sunildewna8165 5 лет назад +1

    Hi naveen i have watched all videos related to pom object model and i have learn a lot now same thing i have implemented on Appium ...and i did it thanks 😊😊

  • @aakrandan
    @aakrandan 3 года назад +1

    Where will be the report generated once I run the executable JAR? I checked it in the project folder's "test-output" folder, but the report is not present.

  • @venkateshsivadurga6456
    @venkateshsivadurga6456 5 лет назад +2

    Thanks Naveen.. I will implement this one ASAP in my current project..

  • @shilpashravge5393
    @shilpashravge5393 Год назад +1

    thanks for the efforts Naveen! great video as usual.

  • @saicharitha704
    @saicharitha704 4 года назад +1

    Hi Naveen, how can I able to create runnable jar containing testclasses and main classes.actually through pom.xml I am able to create jar having only classses in src/main/java but it doesn't include src/test/java classes.

  • @pruthwirajbarik8336
    @pruthwirajbarik8336 5 лет назад +1

    Thanks Naveen its a good approach but tomorrow any changes in ref data again we have to create another jar instead of one jar we can create one folder keep all like excel and executable jar so manual tester also change data and run again and again that i think and am using same in my project also

    • @AkashKumar-wm1gp
      @AkashKumar-wm1gp 4 года назад

      how can i do this plz mail me 66.akash@gmail.com
      thnx in advance.

  • @uttamk9687
    @uttamk9687 5 лет назад +1

    Hi Naveen ... I have testdata in excel under src/main/resources. Executable jar is getting created but when I tried to run via CMD it is showing "FileNotFoundException" for testdata. Could you please help me out.

  • @SarangHoley
    @SarangHoley 5 лет назад +2

    Thanks a lot for this video content, I was expecting this topic vary much to be covered.

  • @priyalal3117
    @priyalal3117 3 года назад

    Thanks Naveen..I have one que I have input file and that need to change by client before running my project then how it can be handled by creating executable jar file

  • @KishoreKumar-jt6jn
    @KishoreKumar-jt6jn 5 лет назад +1

    Hi Naveen,
    Its a nice video,
    I have tried to create a exceutable jar file by keeping the cromedriver.exe inside the project but I could not launch the browser on execution the jar
    But when i keep the cromedriver outside my project I am able to launch the browser
    kindly help me on this

  • @davidbabuvictor632
    @davidbabuvictor632 3 года назад

    My existing project they are generating .jar file using .pom, can you show the demo how we can generate .jar file using maven build for the same project?

  • @mdniyazhashmi
    @mdniyazhashmi Год назад

    Thanks Naveen!! please let me know how to create jar from apache jar plugin also

  • @mohanrajkumar9902
    @mohanrajkumar9902 Год назад

    Hi Naveen, Thanks for the detailed session!
    How to convert the selenium mobile framework project into Jar file. I have created the mobile framework with cucumber based approach. I wanted to convert the project into Jar file to share the test suite to client side. Kindly help the same.
    If you already create the session for that. Please share it. Thank you for the help!

  • @neeharikagarg1233
    @neeharikagarg1233 3 года назад

    Thank you Naveen, I have one question can we run testng-failed.xml from command line using jar.. I know we can do from eclipse not sure how to do this when we have only executable jar..

  • @supriyagm5662
    @supriyagm5662 9 месяцев назад

    For the same testng program, I am getting failure for the command line suite but it's getting success for the test suite. Can you please let me know the reason why I am getting error only for the command suite

  • @monica76859
    @monica76859 5 лет назад +1

    Thank you so much naveen!!
    I have been looking of this topic since very long.. It is Perfect.

  • @sauravrajmitra6804
    @sauravrajmitra6804 5 лет назад +3

    Hi Naveen, can we implement the same in cucumber project ?

  • @himanshupatel7904
    @himanshupatel7904 Год назад

    Thanks a lot, Bro
    What a Great explanation
    Really Great yaar

  • @shanmugakesavan1918
    @shanmugakesavan1918 5 лет назад +1

    I was looking for this information. thank you Naveen.

  • @suryaar8500
    @suryaar8500 4 года назад +1

    Thank you so much Naveen.loving your videos

  • @abraham2961
    @abraham2961 5 лет назад +1

    Thanks for this awesome video Naveen if I want to execute more than one class then should I use , and add those class ??

  • @ashwanityagi5105
    @ashwanityagi5105 3 года назад

    Hi Naveen, thanks for your awesome knowledgeable videos. Could you please also suggest how can we configure test data sheet with our jar files.

  • @yuvraj4870
    @yuvraj4870 5 лет назад +1

    @Naveen AutomationLabs . when I export as runnable jar having OR.properties file. then on running the jar it does not find the path of that OR file mentioned in my java program

    • @vishalgadwal9760
      @vishalgadwal9760 3 года назад

      I am facing this issue have u found the solution?

  • @balabala6136
    @balabala6136 5 лет назад +1

    Naveen can this be implemented in junit? Also where to see the results report?

  • @AshishMishra-wf9sy
    @AshishMishra-wf9sy 4 года назад

    Thanks Navee, this is very details and helpful. I want to understand, if i have excel files which are getting use inside code and i want to export those excel files also with jar. How can i do that and how can i read that inside code. Can you please help me on this?

  • @vrushali69
    @vrushali69 3 года назад

    Hi Navin
    Am able to create clickable jar and running it's fine on my machine however same jar when tried to open in another machine not working
    I have created main class and from there passing TestNG XML file
    I extracted jar on another machine and TestNG XML file is no where to found
    M packing through eclipse only but not sure where doit it wrong
    Ur advice will be really helpful

  • @santoshkpl2088
    @santoshkpl2088 5 лет назад

    lot of amazing videos in ur channel.. thanks naveen for all ur hard work and sharing ur real time experiences..

  • @alokbiswal7830
    @alokbiswal7830 2 года назад

    Hi Naveen,
    In my case I have a cucumber project running with Junit and cucumber options. it does not have testNG and main class, how to convert it to a runnable jar file? Looking forward for your help, Thanks.

  • @JustTry85
    @JustTry85 5 лет назад

    Hi naveen,
    I had followed all the steps which u have show in the above video but the problem is which i am facing is when i am sending the jar file to my manager and he is trying to run that jar it is not working , i tried with the terminal also. Error are coming like config file not found etc etc .
    Please help me to overcome this issue .
    Thanks
    krishnendu saha

  • @matteobellarasa9981
    @matteobellarasa9981 3 года назад

    Hello sir thank u very much for this video. But what about driver paths and csv paths ? do they work in the jar too? can i make them dynamic? Any suggetions what to study to learn this topic?

  • @abhijitmajhi518
    @abhijitmajhi518 5 лет назад +1

    Thanks for sharing knowledge. Can anyone execute the runnable jar which doesn't have maven,Selenium basically dont have the setup..

  • @sambhasin4
    @sambhasin4 5 лет назад +1

    Thanks Naveen for this usefull information.I wants to know that how can we execute multiple different classes in a siquential way.Please comment onto it. i need it urgently.
    Thanks.

  • @umeshbsss
    @umeshbsss 3 года назад

    Hi Naveen,
    What ever you explained in above session is fantastic. We have a similar requirement but will little change. Below is the TestRunner which will trigger all the testcases by mapping "feature" and "glue".
    From the below code you suggested after packaging jar file ran inTestRunner class only @beforeSuite and @AfterSuite will executes, but feature and step definition files will never bind hence non of the test cases are executing.
    Any suggestion to make it work.
    TestNG testng = new TestNG();
    testng.setTestClasses(new Class[] {TestRunner.class});
    @CucumberOptions(strict = true, monochrome = true,
    format = { "pretty", "json:target/cucumber.json" },
    features = {"classpath:feature" },
    glue = { "stepdefinition" }, tags = { "@Sanity" })
    public class TestRunner extends AbstractTestNGCucumberTests {
    @BeforeSuite(alwaysRun = true)
    public void setUp() throws Exception {
    driver = browserActions.openBrowser();
    }
    @AfterSuite(alwaysRun = true)
    public void generateHTMLReports() {

    try {
    browserActions.closeBrowser();

    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }

  • @attitudelove4517
    @attitudelove4517 3 года назад +1

    Hi Bro... I create a jar file this same way... But I'm getting a noclassdeffounderror TestNG exception... How can I resolve it?

    • @snehabandari9002
      @snehabandari9002 Год назад +1

      Hi was this resolved?

    • @BinduRani-bw4mb
      @BinduRani-bw4mb 7 месяцев назад

      @@snehabandari9002 were you able to resolve this error? If yes can you Please share the steps

  • @ajinkyajoshi1749
    @ajinkyajoshi1749 2 года назад

    Hello Naveen,
    My testNG.xml has parameters , values of which I use in my test class.
    Can you tell me how to add these parameters or pass value of these parameters while running ?
    My test cases is failing due to configuration failure.

  • @jyotsanakishore9101
    @jyotsanakishore9101 4 года назад

    Hi Naveen, I have on question. How can we deal with the excel data provider in runnable Jar files. Lets say we are using testNg framework and Data we are passing through excelsheet and then we create a jar file. It runs in the current PC but when we send the Jar file in other PC and run it there. It doesn't run because we dont have data Provider in that PC. Could you please provide the solution??

  • @antonioestevezgonzalez243
    @antonioestevezgonzalez243 2 года назад

    Hi. Could you please Help. I have exported one Jar File. In eclipse i have a Source Directory Named (Configuration). When i execute the application in Eclipse i can have access to the file located in /configuration/config.properties File propertieFile = new File(getClass().getClassLoader().getResource("configuration/config.properties").getFile()); Then i make a Test if(propertieFile.exists(){ System.out.println("exists");}
    My Problem is this works on Eclipse. but when i export my Project in .jar File and execute the Jar File it does not work anymore.
    How do i pass a new File to the File Class for checking is exists when the Project ist exported in Jar File? I have try with URL .toUri many things. I Walk aroud the Google and i dont find yet a solution. I need to check if this file exists in the Resource Folder named configuration and if not to have the chance to create the Properties File. Having a reference from File class.
    Very important i dont use Marven or Spring.
    Is really crazy sometimes the Project looks good in Eclipse and by exporting the Jar File the change the structure.
    You would help me really too much i you have a solution for this problem. i am studying Java and i dont want to give up.
    Thanks.

  • @poulomi21b
    @poulomi21b 5 лет назад +1

    Thanks again for this very helpful video. 👍🏻👍🏻👍🏻

  • @NiceNee.
    @NiceNee. 3 года назад

    Hi Naveen, I am getting blank option in Launch Configuration then how can I select framework

  • @pamujularajesh9417
    @pamujularajesh9417 5 лет назад

    Hi Naveen..how to create a executable jar including Excel and .exe file and how to set path of those file in jar ??
    I created executable jar keeping Excel files in src/main/resources folder but while executing getting error file not found.please provide me solution to handle this scenario.It will really help for me

  • @velun4047
    @velun4047 3 года назад

    Executable jar file not executed outside the project folder and xml files and json files are not available in the executable jar

  • @smeeangle
    @smeeangle 5 лет назад +1

    A good video , passed in eclipse, but if i run the jar, I get java.lang.IllegalStateException: The driver executable does not exist. Any thoughts ? Thanks in advance.

    • @hasini5934
      @hasini5934 5 лет назад

      Hi Sameera, Same issue am facing..do u get any solution for it

  • @Sportz_Monkey_07
    @Sportz_Monkey_07 4 года назад

    Hi Sir Thanks for sharing this important knowledge just got single query that when I am getting error Driver doesn't Exist when I am sharing jar file to my firend.

    • @sandeepnegi4939
      @sandeepnegi4939 4 года назад

      Actually, I have also faced the same issue This is because of the Driver executable , to solve this issue I have used driver executable in my project manually I am not using webdriver manager and then while exporting I have stored the Driver executables in one folder and give it to users

  • @opltest161
    @opltest161 4 года назад

    Sir can we run the jar file at different systems. as its giving me the error of file paths as File not found. I am using File abc = new File("./PrjectFolder/config.properties") then abc.getabolutepath()

  • @jyotidhami6564
    @jyotidhami6564 5 лет назад

    Hello sir. It is not working for me. when I run testing.xml file from eclipse all the testcases are running successfully but when I am running the same from TestRunner class it does not work.

  • @lokeshm3542
    @lokeshm3542 4 года назад

    Hi Naveen i tried to create a jar from intellj ide, while running the jar , it is throwing the error as
    " Could not find or load main class"

  • @kannankrish2108
    @kannankrish2108 5 лет назад +1

    Can we implement this with Junit + Cucumber + Maven based project ?

  • @quepham1382
    @quepham1382 5 лет назад

    Hi Naveen, where I can see your implement on ExtentReportListener class? Thnak you

  • @avanipanchani7588
    @avanipanchani7588 4 года назад

    Hi Naveen , can we implement same with jenkins? there jenkins use for sent report on email.

  • @quepham1382
    @quepham1382 5 лет назад

    Hi Naveen, thank so much for the video. is the extentReport listener required in the xml file in the video 7:14 s?

  • @frustatedengineer
    @frustatedengineer 4 года назад

    Common Dude, after I have created the executable jar, browser is launching only if I run from project directory but if I run from another directory ( say from D:\Media) then browser is not launching.. I have spent 18:07 mins and didn't find answer.

  • @phanikumar5170
    @phanikumar5170 5 лет назад

    Hi Naveen i have tried it is executing as java application but it is not executing as runnable jar file i have followed your concept. Why it is not executing may i know

  • @khushbuvyas7378
    @khushbuvyas7378 3 года назад

    I am getting this error while using ".addListener()" method
    Error - The method addListener(Object) is ambiguous for the type TestNG
    can you help in this?

  • @jayprakashkumar1076
    @jayprakashkumar1076 5 лет назад

    @Naveen
    can you please tell me how to create jar file for testng.xml suite ?
    i need to run xml because i used parallel execution

  • @pankajrachha8724
    @pankajrachha8724 3 года назад

    Hello Sir After extracting the runnable jar file while running the same, it is not able to read data from excel file, could you please help me out on this, Thanks a lot in advance

  • @jaydeepkumarpal2334
    @jaydeepkumarpal2334 5 лет назад +1

    thanks so much naveen it's really amazing technique... i have one silly doubt if i am sending executable jar file to Protect manager , what will be preconceptions to run the jar file on project manager machine .. is that java, eclipse maven should be already installed on not ?

    • @naveenautomationlabs
      @naveenautomationlabs  5 лет назад +1

      only Java should be installed.

    • @jaydeepkumarpal2334
      @jaydeepkumarpal2334 5 лет назад

      @@naveenautomationlabs okey thank

    • @desuvarun255
      @desuvarun255 5 лет назад

      @@naveenautomationlabs How about the chrome browser?and if I want to deploy to Cloud where we have various OS(like Linux, Redhat, Centos,Ubuntu)then what could we do in that case. Still just java is enough?

  • @kaustavdas4897
    @kaustavdas4897 5 лет назад +1

    I have tried to do the same but There are some issue I found :
    1) when Running the jar from the Cmd , it not taking the resources file like : testng and excel logs etc . As I have put the all usable files into the resources folder within the sub folder
    2) I am using the below code :
    TestNG testng = new TestNG();
    List suites = Lists.newArrayList();
    suites.add("run/testng.xml");
    testng.setTestSuites(suites);
    testng.run();
    if i use your code then multiple window is opening and only run the 1st test Class.
    3) In pom i am using the resource add code as well . But no luck .
    this is only running when it would be in parent folder directory .
    COULD you Please help on that ??

    • @pankajrachha8724
      @pankajrachha8724 3 года назад

      Iam facing the same issue, have you got any solution on this ?

    • @snehabandari9002
      @snehabandari9002 Год назад

      Hi, I’m facing this issue has anyone got this resolved?

  • @aasthamaheshwari4524
    @aasthamaheshwari4524 3 месяца назад

    Can you please help me in creating jar files through junit. We are not using testng

  • @lakshmanaikmeghavathu359
    @lakshmanaikmeghavathu359 4 месяца назад

    What is inside the class in the Extent Report Listener?

  • @boopathyraj9128
    @boopathyraj9128 5 лет назад

    Hi Naveen thanks for the above video and it is really useful. I have a few clarifications on this topic.
    1. upon clicking the jar, where can I view the result status once when the all test execution is completed.
    2. does the same set up of eclipse and java is required in the recipient's machine when I share the jar file for execution in their machine. Because the recipient could not run the jar file. please clarify my queries.

    • @sandeepnegi4939
      @sandeepnegi4939 4 года назад +1

      You can create a runnable JAR so in that case you don't need to setup anything in the another machine and also the report will be created in the same folder if you were using the testng

    • @aakrandan
      @aakrandan 3 года назад

      @@sandeepnegi4939 Same folder in the sense where? Could you elaborate more please?

  • @svksuman
    @svksuman 3 года назад

    Hi @Naveen
    I am getting
    Command line suite
    Total tests run: 11, Passes: 0, Failures: 0, Skips: 11
    Configuration Failures: 2, Skips: 0
    error. Can you please help.

  • @rushikeshkhedkar4192
    @rushikeshkhedkar4192 Год назад

    Hey , we are having requirement like we have to pass the runtime parameter from the command line to the executable jar I .e -Ddriver.type = CHROME like this , how we can achieve this can anyone suggest some solutions or any article to deal with this case

  • @chillamcharlabharath9730
    @chillamcharlabharath9730 5 лет назад +1

    Awesome... Thanks Naveen 👍👍

  • @kalyanijoshi6884
    @kalyanijoshi6884 5 лет назад

    I am reading xpath from config file.i am not able to run from cmd too...navin pls pls help

  • @prashantshinde547
    @prashantshinde547 5 лет назад +2

    Thanks Naveen....

  • @stephenbrooks1898
    @stephenbrooks1898 4 года назад

    Hi,
    I have not export to jar option, only export to zip. what is a problem?

  • @sinidevasia1771
    @sinidevasia1771 3 года назад

    Hi Naveen many thanks for this video .While running my jar file on different system getting error file not found exception.How will I fix that .Can you advise me

  • @yuvrajsaini732
    @yuvrajsaini732 4 года назад

    Sir how to create exe which gives us like a drop-down of test cases

  • @sriharinathbendi9868
    @sriharinathbendi9868 5 лет назад

    How to run mutiple test cases or test suite using TestRunnner or jar

  • @ankitsatnalika7171
    @ankitsatnalika7171 3 года назад

    When I execute my JAR file, I get error "Error: Could not find or load main class io.cucumber.core.cli.Main" please help if anyone have idea

  • @nikitapandhare41
    @nikitapandhare41 4 года назад

    Hi Thanks a lot for the information. I tried to execute the same. but during Execution I am getting Configuration Failures. When the same file is executed from Eclipse it works fine. Can you please Help me on this? What could be the cause and how to resolve this issue.
    Thank you.

    • @snehabandari9002
      @snehabandari9002 Год назад

      Hi, I'm facing the same, how did you resolve this? Can you please help me on same

  • @koolvent
    @koolvent 3 года назад

    Great Video ! Thanks a lot!

  • @abraham2961
    @abraham2961 5 лет назад

    Hey Naveen implemented in my project when creating jar file it show some warning msg after when double click on exe file it create output folder where I m getting report but it didn't run the script please reply soon brother

    • @sujit2405
      @sujit2405 3 года назад

      Did you resolve this issue?

  • @baddelajyothiswara6510
    @baddelajyothiswara6510 5 лет назад

    Jar is created successfully , It is working everything fine but other PC's Not working , Other PC's also required Like java and command line or Selenium and it is possible to read properties file ?? Please help me now it is very important for me Thanks in Advance

    • @naveenautomationlabs
      @naveenautomationlabs  5 лет назад

      yes, you need java JRE installed on other machine as well.

    • @baddelajyothiswara6510
      @baddelajyothiswara6510 5 лет назад

      @@naveenautomationlabs Thanks a lot And one more thing Executable jar file is possible read properties file

  • @ranjeetkumarjha7019
    @ranjeetkumarjha7019 3 года назад +1

    great

  • @Jaykate5121
    @Jaykate5121 3 года назад

    how to create a runnable test jar with using gradle instead of creating it from intellij

  • @kannankrish2108
    @kannankrish2108 5 лет назад +1

    i was waiting for this .. TYSM

  • @kalyanijoshi6884
    @kalyanijoshi6884 5 лет назад

    How to add if we are passing the parameters through xml

  • @charantejakirik391
    @charantejakirik391 3 года назад

    i am getting JNI Error on double clicking the jar file :( Please help

  • @sangamsood5651
    @sangamsood5651 5 лет назад

    Is it necessary to add listner or without listner also we can createjar file

  • @trainwithmartina
    @trainwithmartina 4 года назад

    Is there a way to do this with JUnit?

  • @shareefshaik6678
    @shareefshaik6678 5 лет назад +1

    Again FIDA😊👍

  • @prathisanthya5464
    @prathisanthya5464 2 года назад

    Is there a way to create jars for cucumber projects?

  • @aviguptamra
    @aviguptamra 2 года назад

    Hi All,
    I hope, In this pandemic you and your family are well and enjoy the north india winter session
    As per discuss in this video, I have run single testng class but When i add one more testng class that second class didn't run, So anybody having occur same issue and resolved, Please let me know, I would like to say Thanks

  • @riaaggarwal6993
    @riaaggarwal6993 5 лет назад

    where html report will be generated?

  • @GurudattaPraharaj
    @GurudattaPraharaj 3 года назад

    I have a JUnit project. please help

  • @shameem132
    @shameem132 5 лет назад

    Run suite.xml .....write the following in main method.
    TestNG runner=new TestNG();
    List suitefiles=new ArrayList();
    suitefiles.add(System.getProperty("user.dir")+"/testng.xml");
    runner.setTestSuites(suitefiles);
    runner.run();

  • @abraham2961
    @abraham2961 5 лет назад

    Naveen kindly reply please need the solution that's why I ping you here please have some look bro

  • @kalyanijoshi6884
    @kalyanijoshi6884 5 лет назад

    Jar is created with warnings and i am not abke to run

  • @vhvl3888
    @vhvl3888 5 лет назад +1

    nice

  • @AXE-gb4cc
    @AXE-gb4cc 5 лет назад

    but how to embed chromedriver.exe in the project ?

    • @boopathyraj9128
      @boopathyraj9128 5 лет назад

      hare baba!!!! you should specify the file location of the chrome.exe in the test base class.

    • @AXE-gb4cc
      @AXE-gb4cc 5 лет назад

      @@boopathyraj9128 I know dear, just wanted to know how do we need to embed chrome.exe in jar

  • @mariabajwa8632
    @mariabajwa8632 5 лет назад +1

    thank you

  • @mithleshkumar-bb4jr
    @mithleshkumar-bb4jr 10 месяцев назад

    Facing path issue😢😮

  • @khandeshicomedy-by-Jalgvkar
    @khandeshicomedy-by-Jalgvkar 15 дней назад

    Hi, how can we run main class from cmd and pass testng XML on runtime