Selenium Cucumber Java BDD Framework 5 - Parameterization & Data Driven Testing

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

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

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

    watching all Cucumber java videos one by one..really helpful...Thanks

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

      You are most welcome Shaji

  • @preethig5741
    @preethig5741 2 года назад +2

    Thank you Raghav. your sessions are soo good. This session will sure helps the fresher or manual tester to kick start their automation skill

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

      Most welcome Preethi

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

    I was having problem with learning cucumber from other sources. But the way you explain i didnt have any problem understanding. It feels like i found my source of learning all things from you. Thank you very much for working so hard to teach others.

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

      Most welcome

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

      @@RaghavPal Also i dont know if its appropriate to ask here or not. I am working as mechanical Quality engineer from past 10 years but now i watch to switch to IT domain . I have learnt Cucumber with Selenium and also have certification on Selenium with java . Now every recruiter needs experienced people. Do i have any chance to get an interview call as fresher at age of 32. Is it possible to join as fresher in selenium web testing??

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

      Hi, you can learn some more relevant tools and platforms and make some personal projects, upload your projects on GitHub and add the links in your Resume, this will give your profile more weightage and will help in interviews

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

    Thank you very much Raghav, thoroughly explained.
    could you please make videos for
    1. data driven testing using properties file as an input
    2. how to test sqls/unix commands in cucumber.
    3. how to test soap/rest API's using cucumber.
    it would be a great help:)

  • @RajeshR-yp6sy
    @RajeshR-yp6sy 4 года назад +1

    Thank you Raghav, u made us very simple to learn...please make video on how to handle Multiple Feature files with different combinations in reality and how to handle Datatables with Maps

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

    Thank you, sir, you made it very simple and easy. I am very grateful.

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

    Thank you Raghav sir, you have explained it and clearing out all of our clarifications 👍

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

    Hi Raghav, This video was very helpful for me.Thank you very much.👍👍

    • @RaghavPal
      @RaghavPal  2 года назад +1

      Glad to hear that Ismail

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

    only word i can say after watching the video is amazing and thank you for making such videos.

    • @RaghavPal
      @RaghavPal  2 года назад +1

      Thank you so much 😀

  • @rajsonawane5768
    @rajsonawane5768 4 года назад +6

    Hi Raghav, I have watched and recommend this playlist to all my friends and must say its really helpful and easy to understand through your videos. I have one question, can I parameterize rows with no fix column? Such as in 1st row there are 5 column and and in second only 4 and so on. Can I do it using Scenario Outline?

    • @RaghavPal
      @RaghavPal  4 года назад +4

      Glad to know this Raj, you can do but will need to have a logic mostly scripted in step definition as per your needs and scenario.

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

    Nice explanation, glad that I found your videos on many topics - very clear and you make them so simple to remember. great effort and keep going and help all the curious learners.
    Have one question, as here passed 2 sets of data, but if we have multiple sets of data(may be 100 sets) then how to parameterize. Should we use a third party file like .xls or .xslx. If so then how to read the data from the file.

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

      Hi, for a large data set, it is always useful to externalize the data and use options like excel, csv, json files. I will create a session on this. For now this can help you - ruclips.net/video/B4G2tMDYjRQ/видео.html

  • @mayankjain9941
    @mayankjain9941 4 года назад +5

    Thanks, Raghav for very well explained the Parameterization and Data-Driven Testing. Can we use data files i.e CSV, Excel, and database(Oracle.etc) instead of mentioned data details in the feature files? If yes could you please add that video in near future?

    • @RaghavPal
      @RaghavPal  4 года назад +5

      Yes, we can do that Mayank, will plan to add a session on that

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

    Informative and nice explanation. Thank you !

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

      Glad it was helpful Sireesha

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

    super Raghav👌nice lecture to data driven testing in cucumber

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

      Thank you so much Ganesh.. keep watching

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

    Thank you Raghav ! very helpful and clear explanation.

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

    Thanks Raghav. Its Really helpful. Could you please make a video on how to register a website using Datatable in BDD Cucumber.

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

      Hi Suvendu, sure, pls also give me the scenario example of this

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

      @@RaghavPal Suppose we have to register for one or more user on Gillette India website.

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

      Okay, I will plan

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

      @@RaghavPal Thanks a lot.❤️

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

    Thank u Raghav...This is an amazing video for beginners

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

      Glad you liked it Pallavi

  • @jigarrana9249
    @jigarrana9249 2 года назад +1

    HI RAGHAV YOU R A GENIUS 🙏

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

      humbled, thanks Jigar

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

    Thanks for Sharing 🙏🏻🙏🏻

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

    Thanks nice explained.

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

    Thank you so much sir, it's very easy to understand the way you explain.
    Words fall short to thank you for this service.
    I jus wanted to ask you can we implement in the same way in real time too?

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

      You are most welcome Supriya, yes this is how we implement real projects, Basics remain same and then you can grow over it as per the needs

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

    Hi Raghav,
    As always, thanks for the tutorial. I've followed this tutorial and saw some exceptions as I switched to use gecko/FireFox (geckodriver-v0.27.0-win64 and Firefox 81.0 64 bit).
    For any scenario, at the final step I see the exception:
    " org.openqa.selenium.NoSuchWindowException: Browsing context has been discarded"
    Here is the exception from Eclipse terminal:
    Scenario Outline: Check login is successfull with valid crredentials # src/test/resources/Features/LoginDemo.feature:13
    Inside Step: browser is open
    projectPath = C:\Working\Git\GitRepos\eclipse-workspace\CucumberJava
    1601168425609 geckodriver INFO Listening on 127.0.0.1:11548
    1601168426121 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\steve\\AppData\\Local\\Temp\
    ust_mozprofileBO7fNN"
    Can't find symbol 'eglSwapBuffersWithDamageEXT'.
    JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
    console.error: SearchCache: "_readCacheFile: Error reading cache file:" (new Error("", "(unknown module)"))
    1601168431595 Marionette INFO Listening on port 49198
    1601168431950 Marionette WARN TLS certificate errors will be ignored for this session
    Sep 26, 2020 8:00:32 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Detected dialect: W3C
    Given browser is open # StepDefinitions.LoginDemoSteps.browser_is_open()
    Inside Step: user is on login page
    And user is on login page # StepDefinitions.LoginDemoSteps.user_is_on_login_page()
    When user enters Esther and 12345 # StepDefinitions.LoginDemoSteps.user_enters_username_and_password(java.lang.String,java.lang.String)
    And user clicks on login # StepDefinitions.LoginDemoSteps.user_clicks_on_login()
    org.openqa.selenium.NoSuchWindowException: Browsing context has been discarded
    Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'
    System info: host: 'ONGS-41', ip: '192.168.1.97', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '14.0.2'
    Driver info: org.openqa.selenium.firefox.FirefoxDriver
    Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 81.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:buildID: 20200917005511, moz:geckodriverVersion: 0.27.0, moz:headless: false, moz:processID: 31584, moz:profile: C:\Users\steve\AppData\Loca..., moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 10.0, rotatable: false, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
    Session ID: f78aa9b9-95d9-4ff2-b31c-1f4e478091b5
    *** Element info: {Using=id, value=login}
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:196)
    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:129)
    at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:53)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:160)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:582)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:333)
    at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:381)
    at org.openqa.selenium.By$ById.findElement(By.java:194)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:325)
    at StepDefinitions.LoginDemoSteps.user_clicks_on_login(LoginDemoSteps.java:45)
    at ✽.user clicks on login(file:///C:/Working/Git/GitRepos/eclipse-workspace/CucumberJava/src/test/resources/Features/LoginDemo.feature:7)
    Then user is navigate to the home page # StepDefinitions.LoginDemoSteps.user_is_navigate_to_the_home_page()
    Failed scenarios:
    file:///C:/Working/Git/GitRepos/eclipse-workspace/CucumberJava/src/test/resources/Features/LoginDemo.feature:13# Check login is successfull with valid crredentials
    2 Scenarios (1 failed, 1 passed)
    10 Steps (1 failed, 1 skipped, 8 passed)
    0m33.959s
    .... Any help would be appreciated.

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

      Update on this issue:
      If I code the last step like this:
      ------------------------------
      @Then("user is navigate to the home page")
      public void user_is_navigate_to_the_home_page() throws InterruptedException {
      driver.findElement(By.id("saved")).isDisplayed();
      Thread.sleep(2000);
      driver.close();
      Thread.sleep(2000);
      // driver.quit();
      }
      ------------------------------
      ... Then I am able to pass all scenarios (I still seeing an error, though) :
      --------------------------
      Given browser is open # StepDefinitions.LoginDemoSteps.browser_is_open()
      Inside Step: user is on login page
      And user is on login page # StepDefinitions.LoginDemoSteps.user_is_on_login_page()
      When user enters Esther and 12345 # StepDefinitions.LoginDemoSteps.user_enters_username_and_password(java.lang.String,java.lang.String)
      And user clicks on login # StepDefinitions.LoginDemoSteps.user_clicks_on_login()
      1601171372702 Marionette INFO Stopped listening on port 50483
      ###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
      ###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv
      Then user is navigate to the home page # StepDefinitions.LoginDemoSteps.user_is_navigate_to_the_home_page()
      2 Scenarios (2 passed)
      10 Steps (10 passed)
      0m32.412s
      ------------------------------

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

      Hi believe this is coming only for Firefox (Gecko Driver ). check this github.com/mozilla/geckodriver/issues/1279

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

      @@RaghavPal
      I agreed. Thanks for looked it up.

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

    Hi raghav. Thankyou so much for this valuable sessions.. but we want to do this in Intellij Ide so could you please make more sessions by using intellij not with eclips.

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

    Thank you so much 😄

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

    Hi raghav, thanks for the tutorial,
    do you mind show me how to create a logger for cucumber? Thank you in advance..

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

      I will check on this Intan

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

    Thank you so much for the detailed explanation,🙌
    Your video genuinely helped me a lot...!🙏🙏
    while executing, the only changed i observed is if we want to give the sets of username and password then in steps file we have to insert (.+) instead of (.*) and we have to mention the username and password keyword of feature file in instead of " " as the keyword mentioned in " " is static.
    These changes might differ according to the systems and the softwares.
    Please correct me if i am wrong..!

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

      Thanks for adding Omkar

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

    Hi Raghav, could you please explain us how to fetch data from excel in cucumber.

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

      Hi Sneha, can check this: ruclips.net/video/B4G2tMDYjRQ/видео.html

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

    Thanks Raghav. Wonderful videos. These are extremely helpful as I am completely new to automation. Can I use the same framework with Appium also.

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

      Yes, you can Sujatha, You can also check other tutorials here - automationstepbystep.com/

  • @SMSM-gd5dt
    @SMSM-gd5dt 2 года назад

    Thanks Guru

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

    Thank you very much sir, amazing work

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

      Most welcome Dimuthu

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

    At 8:31 , line 41, you said put (.*) for a string. What is the difference between {string} and (.*)? My eclipse didn't run on (.*) (MAC computer)

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

      Hi Seyma, there are diff ways to match a text using regular expression. This story can help you understand better - automationstepbystep.com/2020/05/05/a-story-of-regex/

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

    Hi Raghav, I really like your way of explaining i have one question what is difference between data table and scenario outline ??

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

      Hi Sonali, check this priyank-it.medium.com/cucumber-difference-between-examples-table-data-table-21501f2becbd

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

    Hi Raghav, I have a query when i run logindemo.feature file data is not inserted user name is enter like this i am using ur same code.code is running only one time.

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

      If you are using parameterized values within conical brackets, then you should provide data table in Examples section and the values should be given as arguments in the corresponding function in Step Definition. Check in the video again

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

    Can you please make a video on creating runner file and what is its significance?

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

      Hi Sagar, I must have covered that in some of the video in this series

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

    Hi Raghav,
    Thanks for sharing knowledge, appreciate all your efforts and help..I have one query as below, could you please guide me on the same.
    What if I want open a browser only once and then scenario needs to run multiple time with scenario outline with multiple data mentioned in example, how I can I achieve this.
    For e.g. - I have simple scenario to select report name from the drop-down and click on view button and verify report header, along with data and row count is available.(likewise I have 5 reports in drop-down) So in this scenario I just want to open the browser only once and navigate to the page and perform the scenario I mentioned

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

      Hi, you can put the browser open and navigate to url steps in Background

  • @1911garima
    @1911garima 3 года назад

    Thanks, Raghav very well explained. Can we use data files as CSV or excel for parameterization instead of examples in feature file ? If yes, could you make a video for the same .

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

      Yes, we can, will try a session on this

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

    Very nicely explained, Thanks Raghav!! ..Can you tell how we can read or write from excel in this?

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

      Hi Soumya, will create a session. For now this can help you - ruclips.net/video/B4G2tMDYjRQ/видео.html

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

    Examples:
    | Webpage | Category | SearchMethod | ResultNumber |
    | site1 | Trucks stop | 91911 | 1 |
    | site2 | Bus stop | 20785 | 1 |
    If I try to run this it - Opens both site 1 & 2 using its category but it only uses the search method 91911
    The Gherkin syntax does not show the step and I cant add an additional step without a (duplicate step) error,
    could you point me to minute/video explaining this, please? Thanks, @Raghav!!!

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

      I can't seem to use both integer and string from the same column

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

      that solved the issue, thanks ton for your vids!

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

      great to know

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

    Hi raghav, can u make a video. For selenium grid tests to. Run selenium tests with different. Nodes. Especially Android tablets as a node

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

    Thanks raghav .

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

    Thanks a lot really helpful!

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

      You're welcome Darshana

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

    Hi Raghav, Thanks I was able to login to some other website following your video.One query, I have why we have not created a "Test Runner " here and run the feature file here unlike previous videos.Regards.

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

      Hi Monica, you can run using Test Runner too, I gave examples to show all options

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

      @@RaghavPal Ok thanks.Have you created some content on api testing with karate framework.

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

      Pls ignore it Raghav,I am referring your series on Karate.Thanks.

  • @mandarajgaonkar9003
    @mandarajgaonkar9003 11 месяцев назад

    If there 2 two scenarios here.. in 1 we are testing valid login and in another we are testing invalid login with wrong credentials, then for both the scenarios we have to write "Scenario Outline"? or for first scenario it would be "Scenario Outline" and for 2nd it would be just "Scenario"?

    • @RaghavPal
      @RaghavPal  11 месяцев назад

      You can use a scenario outline for both the scenarios, or you can use a scenario for the first scenario and a scenario outline for the second scenario. It depends on how you want to parameterize your tests.
      If you want to test multiple valid login credentials, then you can use a scenario outline. For example, the following scenario outline would test the login functionality with three different valid login credentials:
      ```
      Scenario Outline: Login with valid credentials
      Given I am on the login page
      When I enter the username ""
      And I enter the password ""
      And I click the login button
      Then I should be logged in
      Examples:
      | username | password |
      | johndoe | password |
      | janedoe | password |
      | admin | admin |
      ```
      If you only want to test a single valid login credential, then you can use a scenario. For example, the following scenario would test the login functionality with the username "johndoe" and the password "password":
      ```
      Scenario: Login with valid credentials
      Given I am on the login page
      When I enter the username "johndoe"
      And I enter the password "password"
      And I click the login button
      Then I should be logged in
      ```
      If you want to test multiple invalid login credentials, then you can use a scenario outline. For example, the following scenario outline would test the login functionality with three different invalid login credentials:
      ```
      Scenario Outline: Login with invalid credentials
      Given I am on the login page
      When I enter the username ""
      And I enter the password ""
      And I click the login button
      Then I should see an error message
      Examples:
      | username | password |
      | invalid | invalid |
      | username | wrong_password |
      | wrong_username | password |
      ```
      If you only want to test a single invalid login credential, then you can use a scenario. For example, the following scenario would test the login functionality with the username "invalid" and the password "invalid":
      ```
      Scenario: Login with invalid credentials
      Given I am on the login page
      When I enter the username "invalid"
      And I enter the password "invalid"
      And I click the login button
      Then I should see an error message
      ```
      Ultimately, the decision of whether to use a scenario or a scenario outline depends on your specific needs and preferences.

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

    Hi Raghav, Great tutorial. I have a small doubt. Why do we have to use ^$ in the When statement. In regex they are used to restrict and match groups. How does using them resolve the error which was thrown first?

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

      Hi Shanjay, although I may have to go a little deeper and check on that, looks like its some syntax in cucumber.

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

      @@RaghavPal No need for the trouble of checking deeper. Just was curious. Thank you so much for the response. If I find out the reason, I will try and post in the comments. Cheers!

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

    I have used the ^ and $ but it is not worked and thrown an error like "you cannot use anchors (^ or $) in Cucumber expressions"

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

      check some examples online and try

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

    Hi raghav getting this error in data driven framework io.cucumber.core.gherkin.FeatureParserException while running feature file ?

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

      Hi Vipin, it can be typo
      Can check this stackoverflow.com/questions/62261565/io-cucumber-core-gherkin-featureparserexception-failed-to-parse-resource-at

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

    Sir apart from giving direct values can we add some Excel file here??
    In data driven?

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

      Yes, we can, This video will be helpful - ruclips.net/video/B4G2tMDYjRQ/видео.html

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

      @@RaghavPal sir with Java +selenium I know to read the data...
      But i was asking about in cucumber how to attach the Excel file for data driven ?

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

      The basic code with remain the same (java Code) can check some examples online

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

      @@RaghavPal ok sir thank you so much for your time 🙏

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

    Hi Raghav!! so i tried the exact same thing you did but with a awebsite of my own. You change your driver to friefox but i stayed in chrome as it opened for me. but the thing is chrome is opening and the website i added is also opening but its not taking the username and password automatically and clicking login as its supposed to. What can i do to fix it?

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

      Leela
      it can be due to the locators of the text boxes (username, password) are not correct or the elements are not loaded, you can try checking the locators and also add some wait time before this step.
      Check the logs, what do they say after failure

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

    Hi Raghav, Do you provide private training as well.

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

    Could anyone please confirm, why ^$ is added on the step definition(part 5 video,at 14.00 minutes)
    thank you

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

      Abhisek
      In Cucumber, adding `^$` to the beginning and end of a step definition serves two primary purposes:
      1. **Restricting Step Matching:** The `^` (caret or hat) symbol at the beginning of the step definition indicates that the entire step text should match the Gherkin step text. This helps prevent unintended step matches and ensures that the step definition is only triggered when the exact step text is used.
      2. **Anchoring Regular Expressions:** The `$` (dollar sign) symbol at the end of the step definition anchors the regular expression used to match the step text. This prevents the regular expression from matching beyond the specified step text, ensuring that the step definition only captures the intended information.
      By using `^$`, you can ensure that your step definitions are triggered only when the exact step text is used and that the regular expressions used for matching are properly anchored. This helps maintain the clarity and accuracy of your step definitions and prevents unintended matches during test execution.

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

    nice video bro keep uploading

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

      Thank you, I will Amit

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

    Hi, I came across one scenarios, where I need to run the TestRunner class
    using cucumber Cli, but the TestRunner is not able to genearte any report
    can you, Please sugggest any ideas/approach to achieve that?
    cucumberCliExampple
    - jars
    - test
    - stepdefinitions
    - *.java
    - features
    - *.feature
    - TestRunner.java

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

      Hi Dushmanta, do you get any logs for this. I will need to check the setup. Try to check some online examples too

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

    Hi Raghav,
    I tried with chrome and gecko drivers, getting the below when trying with gmail as the website. Any suggestions?
    This browser or app may not be secure. Learn more
    Try using a different browser. If you’re already using a supported browser, you can try again to sign in.
    Regards
    Rakesh

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

      Hi Rakesh, this can help - stackoverflow.com/questions/59380356/how-to-handle-browser-or-app-may-not-be-secure-issue-with-web-driver-selenium-py

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

    Hello Raghav, I really appreciate the way you are providing details. It is really helping me. I request to solve this issue when I do your cucumber above part 5, am getting an error as "Null Pointer Exception" though I declared webdriver driver=null. Please help, I stuck here and I tried all the ways making static , public that webdriver.

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

      Hi Praveen, what does the logs say, hope you have added all libraries

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

    Selenium database testing please

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

    I added to Scenario Outline Examples invalid credentials and test still passed. Could you explain why?

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

      Have you added any assertions, test will pass or fail based on your assertions

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

      @@RaghavPal thanks for fast answer, I thought about it, but as you didnt code assertion in your video I thought i can achieve the same result by for example declaring boolean login.logoutDisplayed(); (where logoutDisplayed is a function to locate logout button ofc), but it was not working. Ok i got it assertion is needed. Thank you for your videos man!

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

    Raghav, can we use jdbc driver to connect database in cucumber?
    Does cucumber perform database testing ?

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

      Hi Suhas, Yes, can do

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

    Thanks so much raghav. Could make a video for BDD-datadriven using JSON file as a input.

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

      I will plan

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

      @@RaghavPal thx for your response 👍

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

      Nicely explained with Basics Thanks a lot sir ji

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

    Hi Raghav, good tutorial. Very understandable and precise. Only issue I currently have is I am getting duplicate step definition error which I need to figure out. Let me know how to overcome it. Thanks

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

      Hi, please check if there are any functions have same feature file annotation i.e. referencing similar statements of any feature files

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

      @@RaghavPal Yes I have used similar statements in 2 feature files. How to overcome this since I need those statements in both my features > scenarios.

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

      So you can keep a single function in step definition for this if they are doing the same actions

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

      @@RaghavPal I have mentioned exactly what I am doing below:
      Feature 1
      Scenario 1
      Given User opens chrome browser
      Feature 2
      Scenario 1
      Given User opens chrome browser
      StepDefinition class for Feature 1 I have used Given User opens chrome browser
      StepdDefinition class for Feature 2 I have used Given User opens chrome browser
      Hence when I run them it throws duplicate step definition error (Which is what we discussed earlier)
      If I remove it from Feature 2 it fails after chrome browser opens giving an error driver is null for the next function.
      So wanted to know how to use the same step in feature 2 StepDefinition class.

    • @RaghavPal
      @RaghavPal  2 года назад +1

      Do not remove from feature, but from step definition, So there are 2 ways, either remove the function from one of the step definition OR use a different statement (unique) in 2nd feature and update the step definition accordingly
      OR another way will be to use the runner class and provide the path of the exact step definition you want to use
      stackoverflow.com/questions/55659393/getting-cucumber-runtime-duplicatestepdefinitionexception-despite-adding-backgro/55659727

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

    Hi Raghav, Thanks for your tutorial on parameterization. Could you please tell me how we do drive the test data from excel using SQL queries? Thanks in advance.

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

      Hi Asritha, I will plan to create a session on this

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

      @@RaghavPal thank you:)

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

    Hi Raghav is it enough to understand cucumber framework

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

      Hi Sanjeeva, If you complete this playlist, it will be enough

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

    I see that you can run it directly from the feature file. But when I run it from the feature file, it will not execute. I have to run it using the runner class. Please advise.

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

      Hi Henry, Pls check the setup and all the steps again, Hope you have got the cucumber plugin, restart eclipse

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

      @@RaghavPal I got it. It was my "run as" configuration issue. Thanks!

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

    Hi Raghav thanks for the video.i have implemented same but every time when I run i am getting steps as undefined and test is being skipped.Can you help on this please

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

      Hi Deepika, check your test (class) names. It should start with Test or have this in the name.

  • @sakshijindal6426
    @sakshijindal6426 7 месяцев назад

    Hlo sir i have provided the url from the cucumber table and my scenario is passed but it is not launching the browser.when i hard corded the Url then its working fine.Please sugest me that where is the prob ?

    • @RaghavPal
      @RaghavPal  7 месяцев назад

      Sakshi
      The issue you're describing, where Cucumber-Selenium-Java isn't launching the browser when the URL comes from a Cucumber table but works with a hardcoded URL, can have several causes. Here are some possibilities and suggestions:
      1. Data Parsing Error:
      - Check your step definition. Ensure it properly parses the URL data from the Cucumber table. Verify your `String` parameter receives the value correctly.
      - Double-check typos and whitespace. Minor inconsistencies in the parameter name or table syntax can cause parsing errors.
      2. WebDriver Initialization:
      - Confirm WebDriver configuration. Ensure the WebDriver instance is properly created and initialized to work with the dynamic URL from the table.
      - Test WebDriver creation separately. Run a step definition that just prints the URL obtained from the table to confirm it's correct.
      3. Browser Launching Logic:
      - Review your browser launching code. Verify it uses the URL variable obtained from the table when navigating.
      - Check for conditional logic. Ensure there isn't any logic accidentally skipping browser launch when using a dynamic URL.
      4. Debugging Tips:
      - Print debug messages. Add logs within your step definitions and WebDriver setup to track the URL value at different stages and identify potential parsing or usage issues.
      - Run single scenario. Debug the specific scenario related to the dynamic URL to isolate the problem.

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

    How to perform cross Browser testing in cucumber ... Could you please help

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

      Hi Jyoti, you can use command line to run tests and use different browsers in options, You can also take help from cloud services like Browserstack, Saucelabs etc

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

    Hi @Raghav which version of Eclipse did you use ? I am getting error and cannot install Cucumber plugin for Eclipse 2020-12 developer Version. Need your help for this please

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

      Hi Meena, Eclipse 2020-12 should be fine, what exactly is the issue you are facing, can also check online

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

    What is the use of expression ^ and $?

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

      These are used for regular expressions. Can check this - automationstepbystep.com/2020/05/05/a-story-of-regex/

  • @ajaykumar-gz8df
    @ajaykumar-gz8df 11 месяцев назад

    Hi Raghav,
    Thanks for your videos. When I am trying to log in to Instagram using the automation testing , the username and password cannot be opened automatically. Can you help me?

    • @RaghavPal
      @RaghavPal  11 месяцев назад

      Ajay
      There are a few possible reasons why the username and password fields on the Instagram login page may not be opening automatically when you are using Selenium Java for automation testing:
      *The username and password fields are not visible on the page.* This could be because they are hidden by CSS or JavaScript.
      *The username and password fields are not interactive.* This could be because they are disabled or because they are using a custom input type.
      *There is a race condition between the Selenium Java code and the Instagram login page.* This could be because the username and password fields are being loaded and initialized asynchronously.
      To troubleshoot this issue, you can try the following:
      1. *Check the visibility of the username and password fields.* You can use the `isDisplayed()` method to check if a web element is visible on the page.
      2. *Check the interactivity of the username and password fields.* You can use the `isEnabled()` method to check if a web element is interactive.
      3. *Add wait statements to your Selenium Java code to give the Instagram login page enough time to load and initialize the username and password fields.* You can use the `WebDriverWait` class to add wait statements.
      Here is an example of how to add a wait statement to your Selenium Java code:
      ```java
      WebDriverWait wait = new WebDriverWait(driver, 10);
      wait.until(ExpectedConditions.visibilityOf(usernameField));
      wait.until(ExpectedConditions.elementToBeClickable(usernameField));
      ```
      This code will wait for 10 seconds for the username field to become visible and interactive. If the username field does not become visible and interactive within 10 seconds, the test will fail.
      If you are still having trouble logging in to Instagram using Selenium Java, you can try using a different automation testing framework, such as Cypress or TestCafe. These frameworks are specifically designed for testing web applications, and they may be able to log in to Instagram more reliably than Selenium Java.

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

    Hi Raghav, please help me. My parameterisation is not working.
    @When("^user enters valid (.*) and valid (.*) and login$")
    public void user_enters_valid_username_and_valid_passward_and_login(String str1, String str2) {

    }
    Tried this
    eclipse (after running as cucumber file) is giving wrong code tidy gherkin is giving code with .+ , but not working. I practiced before they worked but now eclipse is behaving different. why? I have recently changed my java version though (to practice jerkins). before it was 16, now I am using jdk11. what to do? I want to make a selenium cucumber framework but this problem is happening.I am frastrated.
    first data set is passing through but others not .
    Thanks in advance

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

      Hi, I will need to check, not sure if this is due to java

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

      @@RaghavPal Thanks . not for java. Because I have installed again new eclipse. java 16. Something is happening after converting the maven project to cucumber project. May be some problem with latest cucumber plugin in eclipse. don't know .Any way really thanks for your reply. I was thinking to practice to build a cucumber selenium framework but now decided to do selenium testng first . Thanks

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

    Hi raghav,
    Is there any way to read examples data in feature file from external file like CSV, Excel or json?, Since my data is huge

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

      Hi Trilok
      Yes, you can read examples data in the feature file from external files like CSV, Excel, or JSON using a data provider. Here are the steps to do it:
      Add the data provider library to your project, such as Apache POI for Excel or OpenCSV for CSV.
      Create a class to read data from the external file and return it in a format that can be used by your step definitions. For example, you can create a method that reads data from a CSV file and returns a list of maps, where each map represents a row in the CSV file and contains key-value pairs for each column in the row.
      Annotate your scenario with the data provider and specify the method that reads the external file as the data provider. You can also specify the data format, such as "csv" or "excel".
      Can find some examples and code online

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

      @@RaghavPal ,
      Thanks raghav for quick response ❤️, please share me if we already have any video tutorial, raghav

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

      I do not have a specific focussed video on this, but if you check the video using @DataProvider annotation, the same can be used here ruclips.net/video/B4G2tMDYjRQ/видео.html

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

    How will we make browser driver dynamic as its version keep changing, now 83, tomorrow it will be 90, so scripts will not work other system, how can we fix this?

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

      We can use Webdriver Manager, Check this - ruclips.net/video/8vWTgyoG0nc/видео.html

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

    Hello Raghav
    Dont we need to use test runner class to run the test?

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

      You can, just follow the steps

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

    Hi sir. I followed everything you did and it did not work. I then removed the angle brackets at the 'When' statement and it worked. Is this a concern to be worried about?

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

      should be okay if its working

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

      @@RaghavPal I added another account to test and when i ran the test it went through the first account in my outline twice. Rather than the first account followed by the second.

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

      ok

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

    Hi ,my previously working project stopped by giving this error .WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main
    Can you please help me on this?

    • @RaghavPal
      @RaghavPal  2 года назад +1

      Hi Suchi, can try changing cucumber ver

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

    Please show how to use data table in Cucumber.

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

      Hi Rajendra, did that in earlier video of this series. Pls check automationstepbystep.com/

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

    Please ,how do i change feature file to português (Brazil)?. For him to generate in my language.

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

      Not sure on this Mike, will need to check online

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

    sir , while running program password is invalid comes in both d times i set pass 12345 for both username so whts d problem?

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

      Hi Snehal, not sure, send me the url

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

      @@RaghavPal thanks sir for your reply..problem has been resolved.. the password was taking extra white space so I used the trim method.

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

      @@snehaldatir2419 i have the same issue, how can iuse the trim method ?

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

    Hi raghav . I am facing some issues . I am getting error as cucumber.api.cli.main run and it's saying as warning you are using deprecated main class. Please use if.cucumber.cli.main it's saying . What should I need to do to clear this error??

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

      Hi Keerthana, in case its only warning, you can continue

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

      Web is not opening

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

      will need more details, may be your browser and driver ver not compatible

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

    Hi, ^user enters (.*) and (.*)$ is not working for me. I'm unable to enter password, instead username is filled with both the strings of username and password. Can I know what's the solution for this?

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

      Hi Apoorva, pls check if you have used exactly the same syntax as shown, Can copy from some website having similar examples

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

    Hi Raghav,
    I have tried same Parameterization data, but while running the file it is taking 6 digit password and i have mentioned same data what ever you have mentioned, I tried to print the Password then it is showing 5 digits but in screen it is entered 6 digit and showing invalid password

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

      Hi Shanthi, try to use print statements to check what value is referred.

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

      @@RaghavPal implemented print statement it is showing as 12345 but in application it is taking 6 digit and getting invalid password
      Thanks for your reply

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

      Will need to check and troubleshoot this Shanthi.

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

      @@RaghavPal could you please share mail id to send my code

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

      Hi Shanthi, you will need to do some initial analysis and if required can share your understanding with me, I may not be able to take out time for troubleshooting from scratch. Can check this - ruclips.net/video/745IUcLg7B4/видео.html

  • @SunilKamble-v9n
    @SunilKamble-v9n Месяц назад

    Code not visible properly due to subtitles

    • @RaghavPal
      @RaghavPal  Месяц назад

      will need more details and context to help on this Sunil

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

    Hi Raghav, how do i read from .yaml file? thanks!

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

      Hi Adrienne, I will consider this in a session. for now pls take online help

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

    how can we run secnario outline in parallel form..? And in Different browser at a same time.?

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

      Hi Tanmay, we can use options like TestNG

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

      @@RaghavPal Can you please add a video tutorial of that..?

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

      I will plan

  • @ZyboroTown
    @ZyboroTown 10 месяцев назад

    How to parameterize soap requests using scenario outline

    • @RaghavPal
      @RaghavPal  10 месяцев назад +1

      Parameterizing SOAP requests using Scenario Outline in Selenium Java Cucumber involves defining a Scenario Outline with placeholders for the SOAP request parameters and then providing a set of examples to populate those placeholders.
      Here's a step-by-step guide:
      1. **Create a Scenario Outline:**
      ```gherkin
      Scenario Outline: Send SOAP Request with Parameters
      Given I send a SOAP request to ""
      Then the SOAP response status code should be
      ```
      2. **Define Placeholders for Parameters:**
      Replace `` and `` with placeholders for the SOAP request endpoint URL and expected status code, respectively.
      3. **Create Examples Table:**
      ```gherkin
      Examples:
      | endpoint | statusCode |
      | example.com/soap/ | 200 |
      | example2.com/soap/ | 404 |
      | example3.com/soap/ | 500 |
      ```
      Replace the example URLs and status codes with your actual values.
      4. **Implement Step Definitions:**
      Create step definitions for the `Given` and `Then` steps:
      ```java
      @Given("I send a SOAP request to {string}")
      public void sendSOAPRequest(String endpoint) {
      // Implement SOAP request logic using a SOAP client library
      }
      @Then("the SOAP response status code should be {int}")
      public void verifySOAPResponseStatus(int expectedStatusCode) {
      // Verify the SOAP response status code
      }
      ```
      5. **Run Cucumber Tests:**
      Execute the Cucumber tests using a Cucumber Runner or a test automation framework like JUnit.
      The Scenario Outline will be executed for each set of data provided in the Examples table, effectively parameterizing the SOAP requests.

    • @ZyboroTown
      @ZyboroTown 10 месяцев назад

      @@RaghavPal thank teacher

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

    Hello sir ,your videos are very helpfull.
    I am facing one issue in above concept .I am giving the password as 12345 in config file,still after running the code it is showing password invalid and login is unsuccessful. Could you pls help

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

      Hi Rajat, where did you set this password

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

      @@RaghavPal in the feature file itself

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

      will need to check the syntax

  • @krisragu4685
    @krisragu4685 Месяц назад +1

    I have no doubt selenium is very powerful but like QTP why didn't they enhance it to be record and playback? After all it's web applications testing....
    Record, stop, playback then add code to modify as needed! Why didn't they do that? Beats me 😆 🤔

    • @RaghavPal
      @RaghavPal  Месяц назад

      Kris
      Selenium has it - Selenium IDE www.selenium.dev/selenium-ide/. Can also find my tutorials on this here -
      ruclips.net/video/4I7xay_NV8A/видео.html
      ruclips.net/video/uO8_Dfe4pd4/видео.html
      ruclips.net/video/bzGsHmEyea0/видео.html

    • @krisragu4685
      @krisragu4685 Месяц назад

      @@RaghavPal THX. So can people learn that selenium IDE package directly? And learn minimal Java coding and be good enough to call themselves automation tester?
      The way I see it, you only need to tweak code if needed. Add delays, conditions, loops ETC.i mean we're not building, we're testing what was built!

    • @RaghavPal
      @RaghavPal  Месяц назад +1

      it will be very helpful during automation. You can do recording and generate the code and use in your framework projects. I will suggest learning basic programming will help and take you long way

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

    How to create automation mobile with flutter driver ?

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

      Hi, As of now, I have not worked on this

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

    That means Firefox are not in the game yet looking at the gecko driver they are still developing

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

      it is used for automation testing, but yes chrome is most widely used today

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

    Hi, Raghav, Thanks for the beautiful explanation.
    Can we use "WebDriverManager.chromedriver().setup();" to avoid these driver versions related issues ?(mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager). If we use this, then we don't need to keep "chromdriver.exe" files in the Framework
    Is this recommended ??

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

      Yes you can Shiva. Pls watch this - ruclips.net/video/8vWTgyoG0nc/видео.html

  • @BNagaraj-uy6li
    @BNagaraj-uy6li 4 месяца назад

    Raghav sir,
    With latest version of cucumber, I'm getting the below issue. Can you please suggestion any solutions
    Could not find or load main class cucumber.api.cli.Main

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

      Nagraj
      the error message "Could not find or load main class `cucumber.api.cli.Main`" typically occurs when the specified class cannot be located or loaded during runtime. Let's explore some potential solutions:
      1. Check Your Run Configuration:
      - Verify that your run configuration is correctly set up. Sometimes, after refactoring or module changes, the run configuration might default to an incorrect setup.
      - Delete all existing configurations (you can find the dropdown in the top right of the IntelliJ IDEA window) and remove the Cucumber Java configuration.
      - Right-click on the main application you want to run and select "Run" or use the shortcut `Ctrl + Shift + F10`.
      2. Update Dependencies:
      - Ensure that you are using the latest version of Cucumber dependencies. Update the version numbers in your build tool configuration file (e.g., `pom.xml` for Maven or `build.gradle` for Gradle).
      - Run the following commands to download the latest dependencies:
      - For Maven: `mvn clean install`
      - For Gradle: `gradle clean build`
      3. Use the Correct Class Name:
      - The class `cucumber.api.cli.Main` is deprecated. Instead, use `io.cucumber.core.cli.Main`.
      - Make sure to update your code to reference the correct class name.
      Remember to adjust your project settings and dependencies accordingly. If you follow these steps, you should be able to resolve the issue.

    • @BNagaraj-uy6li
      @BNagaraj-uy6li 4 месяца назад

      Hi Sir,
      Here is the full error message
      May 07, 2024 11:59:53 PM cucumber.api.cli.Main run
      WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main
      io.cucumber.core.exception.CompositeCucumberException: There were 2 exceptions. The details are in the stacktrace below.
      at io.cucumber.core.runtime.RethrowingThrowableCollector.getThrowable(RethrowingThrowableCollector.java:57)
      at io.cucumber.core.runtime.CucumberExecutionContext.getThrowable(CucumberExecutionContext.java:109)
      at io.cucumber.core.runtime.Runtime.run(Runtime.java:78)
      at io.cucumber.core.cli.Main.run(Main.java:87)
      at cucumber.api.cli.Main.run(Main.java:30)
      at cucumber.api.cli.Main.main(Main.java:15)
      Suppressed: java.lang.UnsupportedClassVersionError: org/openqa/selenium/WebDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.
      at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at io.cucumber.java.MethodScanner.safelyGetMethods(MethodScanner.java:39)
      at io.cucumber.java.MethodScanner.scan(MethodScanner.java:32)
      at io.cucumber.java.JavaBackend.lambda$loadGlue$2(JavaBackend.java:41)
      at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
      at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:44)
      Suppressed: java.lang.UnsupportedClassVersionError: org/openqa/selenium/WebDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      I installed the new eclipse and fallowed your videos also but getting the same error.
      Any paid support call from you sir? I need to implement a new project for my company

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

      Let's break down the error messages and address them step by step:
      1. Deprecated Main Class Warning:
      - The warning message indicates that you're using a deprecated Main class for running Cucumber tests.
      - To resolve this, update your test runner class to use the new `io.cucumber.core.cli.Main` class instead of the deprecated one.
      - Make sure your test runner class (the one annotated with `@RunWith(Cucumber.class)`) references the correct classpath for your feature files. For example:
      ```java
      import org.junit.runner.RunWith;
      import cucumber.api.CucumberOptions;
      import cucumber.api.junit.Cucumber;
      @RunWith(Cucumber.class)
      @CucumberOptions(features = "classpath:com/yourgroup/yourartifact/cucumber/features")
      public class RunCucumberTest {
      // Your test configuration
      }
      ```
      - Replace `"classpath:com/yourgroup/yourartifact/cucumber/features"` with the actual path to your feature files.
      2. UnsupportedClassVersionError:
      - This error occurs because the `org.openqa.selenium.WebDriver` class has been compiled with a newer version of Java (class file version 55.0), but your current Java Runtime only recognizes class file versions up to 52.
      - To fix this, ensure that your project is using a compatible Java version. You can check your Java version by running `java -version` in your terminal.
      - If you're using an older Java version, consider upgrading to a more recent one (Java 8 or higher).
      3. Eclipse Configuration:
      - Since you mentioned installing a new Eclipse, make sure you've configured your project correctly within Eclipse.
      - Verify that your project is using the correct Java SDK (matching the version you want to use).
      - Also, check if your project build path includes the necessary Selenium and Cucumber dependencies.
      4. Implementing a New Project:
      - If you're starting a new project for your company, consider the following steps:
      - Create a new Maven or Gradle project (depending on your preference).
      - Add the necessary dependencies for Selenium (e.g., `webdriver`, `webdrivermanager`) and Cucumber (e.g., `cucumber-java`, `cucumber-junit`).
      - Set up your feature files, step definitions, and test runner class.
      - Write your BDD scenarios in Gherkin syntax within the feature files.
      - Implement the step definitions to map Gherkin steps to Java code.
      - Run your tests using the updated test runner class.
      Remember to keep your Java version consistent across your project and ensure that all dependencies are correctly configured
      ---

    • @BNagaraj-uy6li
      @BNagaraj-uy6li 4 месяца назад

      @@RaghavPal Thanks for your quick response Sir. Ya as you said , it was a jav version issue. Did the changes in build path Java 8 to 11 then it worked

  • @786Muhaimin
    @786Muhaimin 4 года назад

    Thanks a lot really helpful!

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

      You're welcome Abdul