Groovy Beginner Tutorial 23 | OOP | Classes & Objects

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ม.ค. 2025

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

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

    Hi Raghav Pal. How can I use this for integrating Jenkins pipeline with stages as classes? A video on that will be greatly useful.

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

      Hi Phila, I will check and plan a video on that.

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

    too large fort size ad small space for write program so complete program not visible

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

      I will check on this Pratap,

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

    Thank you Sir, this tutorial was amazing

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

      Most welcome Harry

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

    Awesome Raghav! Please start katalon advance course been waiting! Thanks mahesh

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

      Yes, Mahesh, I too am waiting to get some focussed time. But will do it definitely

  • @AyubKhan-lj6sz
    @AyubKhan-lj6sz 4 ปีที่แล้ว

    Hi Raghav!
    Awesome tutorials
    I need some guidance on classes and objects
    I am learning Groovy language for SOAPUI and writing code in SOAPUI
    But I am facing this error
    please help
    Here is my code
    class Student {
    String Name;
    int Mark1;
    int Mark2;
    def printTotal(){
    log.info "$name has total marks :"+(Mark1+Mark2)
    }

    public static void main(args) {
    // TODO Auto-generated method stub
    Student st = new Student ()
    st.Name = "Ali"
    st.Mark1 = 30
    st.Mark2 = 50
    st.printTotal()
    }

    }
    Error Message
    groovy.lang.missingPropertyException no such property : log for class Student

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

      Hi Ayub, you will need to add a constructor and pass log variable.
      class Example {
      def log
      def context
      def testRunner
      // Class constructor with same case as Class name
      def Example(logIn,contextIn,testRunnerIn) {
      this.log = logIn
      this.context = contextIn
      this.testRunner = testRunnerIn
      }
      }
      We need to instance of the class; add the following to the end of the Script, outside the class definition. This will place the instance in the project's context.
      context.setProperty( "example", new Example( log, context, testRunner) )
      log.info "Library Context:"+context
      community.smartbear.com/t5/SoapUI-Pro/How-to-write-a-reusable-script-Library/td-p/29499

    • @AyubKhan-lj6sz
      @AyubKhan-lj6sz 4 ปีที่แล้ว

      @@RaghavPal thanks a lot Raghav

    • @AyubKhan-lj6sz
      @AyubKhan-lj6sz 4 ปีที่แล้ว

      Hi Raghav
      How i can get a soap or rest api from a website ?