SoapUI Beginner Tutorial 8 - GROOVY Scripting in SoapUI | Getting Started

  Рет қаралды 94,539

Automation Step by Step

Automation Step by Step

Күн бұрын

Today we will learn:
-----------------------------
1. What is Groovy
2. How to add groovy scripts in SoapUI
3. How to do basic coding in groovy in SoapUI
4. Basic Object Oriented Programming. (Classes and Objects)
References
en.wikipedia.o...
www.soapui.org...
Code Snippets
=============
import java.io.*;
log.info (" Hello World ... ");
int a = 10 ;
int b = 20 ;
int c = a+b ;
log.info (" Result is : "+c) ;
// this is a single line comment
/*
This is
multiline comment
*/
//log
//context
//testRunner
log.info testRunner.metaClass.methods*.name.unique().sort()
======================
class Hello{
def log;
def context;
def testRunner;
def Hello(log, context, testRunner){
this.log = log
this.context = context
this.testRunner = testRunner
}
def sayHello(String name){
log.info (" Hello "+name);
}
}
context.setProperty("Hello", new Hello(log,context,testRunner))
========================
def testStep = testRunner.testCase.getTestStepByName("Hello")
testStep.run(testRunner, context)
context.Hello.sayHello("Raghav")
============================
project = testRunner.testCase.testSuite.project ;
tcase = project.testSuites["TestSuite3"].testCases["TestCase1"] ;
hello = tcase.getTestStepByName("Hello");
hello.run(testRunner, context)
context.Hello.sayHello("Raghav")
project = testRunner.testCase.testSuite.project ;
tcase = project.testSuites["TestSuite"].testCases["TestCaseName"] ;
hello = tcase.getTestStepByName("Hello");
log.info testRunner.metaClass.methods*.name.unique().sort()
context.setProperty("Hello", new Hello(log,context,testRunner))
def hello = testRunner.testCase.getTestStepByName("Hello");
hello.run(testRunner, context)
def ref = context.Hello;
ref.printHello("Raghav");
==============================================
SoapUI Playlist -
• SoapUI
Like on Facebook - / automationstepbystep
Subscribe on:
KZbin - / automationstepbystep
_______ ONLINE COURSES TO LEARN _______
Visit - automationstepb...

Пікірлер: 145
@RaghavPal
@RaghavPal 6 жыл бұрын
Online courses - automationstepbystep.com/
@uhsbangalore2930
@uhsbangalore2930 4 жыл бұрын
We have implemented this groovy explained in the video, its a big success for the project. Thank you!
@RaghavPal
@RaghavPal 4 жыл бұрын
So happy to know this Ullasa
@kevinpowers6875
@kevinpowers6875 Жыл бұрын
You taught me how to run any testCase, which is awesome and just what we needed to reduce regression tests in soapUI. Many thanks and Kudo's!
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome
@emilioastier
@emilioastier Жыл бұрын
Hi Raghav, your videos are really educational and useful. They are of great help to me to better understand groovy in automation tests. greetings from Spain.
@RaghavPal
@RaghavPal Жыл бұрын
Glad to hear that Emilio
@yatishankarbandyopadhaya1275
@yatishankarbandyopadhaya1275 4 жыл бұрын
I strongly believe complete newbies like me find it very difficult to understand why are we starting with groovy in the first place. so far i had understood loading the WSDls, end point URLs, sending the request, getting a valid response, creating a test suite>test case>test step. From a practical standpoint it would be helpful for me to know why do i need to learn groovy after this. In my project on webservice testing i didnt need it. So if you could start with a basic intro as to why do we need groovy here will be helpful
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Yatishankar, I got your point. A session on why its needed, where it will help etc will help. Although some of this is mentioned during the sesion, but I can understand for newbies, a separate session will help. Will try to add this
@rahuljaiswal611995
@rahuljaiswal611995 3 жыл бұрын
@@RaghavPal Thank you for your lucid explanations .. please help to find the separate session which you have mentioned above .
@PriyaBhandariOfficial
@PriyaBhandariOfficial 4 жыл бұрын
Hi Raghav, You are an awesome teacher. As a student, the only thing that makes us more clear is if you give a meaningful name to a particular test case or test suit or for any method you are using will help us to understand in the best way. I am getting too much confused on name like test suit 1, test case 2, and so on. sorry about that. Else Everything is perfect.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Prabhat, I completely got your point Prabhat and will take care of this in future tutorials
@f.r.i.e.n.d.s2127
@f.r.i.e.n.d.s2127 3 жыл бұрын
Thank You Raghav , It is very useful and very understanding .
@RaghavPal
@RaghavPal 3 жыл бұрын
Most welcome Rajani
@mohammadamin8042
@mohammadamin8042 6 жыл бұрын
Hi Raghav your presentation is very helpfull thank you somuch.
@RaghavPal
@RaghavPal 6 жыл бұрын
You're welcome Md. Amin
@FosterSB
@FosterSB 2 жыл бұрын
Your videos are very helpful and well organized. I like the use of notepad! When you get to the crux of a helpful point perhaps slow down a tad so that I needn't pause the video (if you're still making these years later). Thanks!
@RaghavPal
@RaghavPal 2 жыл бұрын
Awesome, thank you!
@nrravitej2498
@nrravitej2498 5 жыл бұрын
Hi Raghav, @9:45 , the list of printed methods from testRunner class is not having the testCase method. This testCase is very commonly used method right, why is its not available in the list of methods got printed?. Below are the methods names printed [cancel, equals, fail, getClass, getLog, getReason, getResults, getRunContext, getStartTime, getStatus, getTestCase, getTestRunnable, getTimeTaken, gotoStep, gotoStepByName, hashCode, isRunning, notify, notifyAll, runTestStep, runTestStepByName, setMockRunContext, setRunContext, start, toString, wait, waitUntilFinished] Please clarify this doubt.
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi, pls check the api doc here - www.soapui.org/apidocs/com/eviware/soapui/model/testsuite/TestRunner.html
@AbhishekGupta-1807
@AbhishekGupta-1807 Жыл бұрын
Sir for me the last demo didn't work the error is " Mon Dec 25 16:11:10 IST 2023:ERROR:An error occurred [Cannot get property 'testCase' on null object], see error log for details "
@RaghavPal
@RaghavPal Жыл бұрын
Abhishek Here are the steps to address it: 1. Analyze Error Details: Review Error Log: Inspect SoapUI's error log for specific line numbers and clues about the script's context. Check Console Output: Look for additional error messages or stack traces that might provide more insights. 2. Identify Null Object: Examine Variable Usage: Carefully review your script to determine where the testCase property is being accessed. Verify Context: Ensure that the script is executing within a valid test case context where the testCase property should be accessible. 3. Common Causes and Solutions: Incorrect Script Placement: If the script is not within a test case or test step, it won't have access to the testCase property. Move the script to the appropriate location within a test case or test step. Missing Test Case Reference: If the script is in a separate file or custom library, ensure it's properly referencing the test case object. Pass the test case object as a parameter to the script or use appropriate methods to access it. Script Execution Order: If the script depends on other test steps or variables, verify that they are executing in the correct order. Adjust the test case structure or use conditional logic to ensure proper execution flow. Global Properties: If you're using global properties, double-check their names and values to ensure they are defined correctly. 4. Debugging Tips: Use Logging: Add log.info statements to print variable values and track script execution flow. Isolate the Issue: Comment out parts of the script to narrow down the problematic code. Test Incrementally: Build and test your script in small, manageable sections. 5. Additional Considerations: SoapUI Version: If you're using an older SoapUI version, consider upgrading to avoid compatibility issues. Script Complexity: For complex scripts, consider using techniques like modularization and error handling to improve readability and maintainability.
@nagaswaraok4134
@nagaswaraok4134 5 жыл бұрын
hi thank you for giving this valueable infirmation great sir there no one canot expail like this clearly about groovy
@RaghavPal
@RaghavPal 5 жыл бұрын
You're welcome Nagaswa:)
@sanasayed5890
@sanasayed5890 4 жыл бұрын
Good explanation sir of every topic...keep it up
@RaghavPal
@RaghavPal 4 жыл бұрын
Thanks and welcome Sana
@performancetestengineer-go2294
@performancetestengineer-go2294 6 жыл бұрын
Raghav pal sir your my best teacher
@RaghavPal
@RaghavPal 6 жыл бұрын
Great to know this Gowri. I am humbled.
@pragatishukla1720
@pragatishukla1720 5 жыл бұрын
Thanks for the wonderful video. Please let me know how to run more than on e test steps or test cases using single statement
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Pragati, What exactly is your scenario, In case you want to run in a loop you can do that using groovy script. e.g. // This will get the list of all testSteps in the testCase def testSteps = context.testCase.getTestStepList() testSteps.each{ // This block will loop through the test steps and print the test step name to the log log.info(it.name) }
@pragatishukla1720
@pragatishukla1720 5 жыл бұрын
@@RaghavPal thanks this is all I wanted.
@pavithralakshminarasimhan2623
@pavithralakshminarasimhan2623 6 жыл бұрын
Very helpful to get started using groovy
@RaghavPal
@RaghavPal 6 жыл бұрын
Great to know this Pavithra
@zonacs4259
@zonacs4259 11 ай бұрын
Hi Raghav, firstly i thank you for your tutorial serie, very helpful also because regarding SoaupUi, there aren't much guides out of here nowdays. So, i want to ask you one ore more practical use cases to implement a object-oriented program in a api test. I've seen this when implementing Selenium with customs libraries in e2e testing, but i can't immagine a usefull case in api testing.
@RaghavPal
@RaghavPal 11 ай бұрын
While object-oriented programming (OOP) isn't as prevalent in API testing as it is in UI testing, there are certainly practical use cases where it can bring significant benefits: 1. Modeling Complex Data Structures: * API responses or requests often involve nested objects and arrays. Object-oriented data structures like classes and interfaces can effectively represent these complexities, making tests more readable and maintainable. * Create dedicated classes for "user", "order", "product", etc., with properties and methods reflecting their real-world counterparts. 2. Reusability and Modularity: * Break down common test logic into reusable methods within classes. This promotes code reuse and reduces duplication across tests. * Implement "base classes" for common API interactions (authentication, authorization), and inherit them for specific tests, reducing boilerplate code. 3. Encapsulation and Abstraction: * Encapsulate complex logic within methods or properties, hiding implementation details and improving test readability. * Use interfaces to define expected behaviors without specifying concrete implementations, promoting flexibility and future changes. 4. Data-Driven Testing: * Create classes to encapsulate different test data sets, making data-driven testing more organized and scalable. * Use inheritance or composition to create variations of test data based on specific scenarios. 5. Mocking and Stubbing: * Develop custom mock objects mimicking external dependencies (third-party APIs, databases) using OOP principles. * This allows isolation and control of these dependencies in your tests. Examples: * Product API testing: Create a `Product` class with properties like ID, name, price, and methods for CRUD operations. Write tests that interact with the API using this class for clarity and reuse. * Authentication testing: Build an `Authentication` class with methods for login, logout, and token management. Leverage inheritance for specific authentication flows (OAuth, Basic Auth). Remember, OOP isn't always necessary, but when dealing with complex APIs or aiming for maintainable and scalable tests, it can provide significant advantages. Don't hesitate to adopt it when it enhances your testing practices.
@mayankjain9941
@mayankjain9941 4 жыл бұрын
Nicely explained about groovy scripting thanks a lot!!!
@RaghavPal
@RaghavPal 4 жыл бұрын
Most welcome Mayank
@lolworld2178
@lolworld2178 3 жыл бұрын
what is the purpose to write run method? Why we have pass those 2 arguments and from where they will get value?
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi, its inbuilt in SoapUI, you can see the documentation for more details
@ashishnaidu2487
@ashishnaidu2487 2 жыл бұрын
Hi Raghav, your teaching is amazing and very easy to follow and did a hands on too and it was very productive. But in this video I was unable to follow much of it, I lost it at the very beginning itself maybe due to as I have zero programming knowledge. So, can you guide and assist me how to overcome this gap. Thanks again!
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Ashish, can learn Groovy from my tutorials here - automationstepbystep.com/
@ashishnaidu2487
@ashishnaidu2487 2 жыл бұрын
@@RaghavPal Thanks a lot! Raghav for the much valuable and helpful assistance.
@SagarSagar-ro3fj
@SagarSagar-ro3fj 3 жыл бұрын
context Analogy...if i understand it correctly ... once we create a class and its methods, then we call it from different class. But, here we need to define variable to the class -def testStep = testRunner.testCase.getTestStepByName("Hello"); .this is something like deciding which which fun activity to go in the amusement park. Once we decide, we need a different passes/tickets to play the different rides. these pass/tickets are "Context" testStep.run(testRunner, context); . Once we get the pass we get access to that ride/area in amusement park. Once we do enter there we can play the ride which is actual function calling activity. context.Hello.sayHello() Lol..just trying to figure it out.confirm if this right and easy way to understand context..because context object is used in different languages as well for example dart in flutter.
@RaghavPal
@RaghavPal 3 жыл бұрын
yes, can go with it
@ashwin4399
@ashwin4399 3 жыл бұрын
What is the difference between context and TestRunner as both the usage are same??
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Ashwin, pls check this stackoverflow.com/questions/25184307/what-t-is-the-difference-between-context-and-testrunner-in-soapui
@jyothirmaisivaram8934
@jyothirmaisivaram8934 4 жыл бұрын
Hi Raghav, Very well explained. Can you please provide syntax too? Example: to call a class that is defined in another test case. tcase=project.teststeps("").testcases("");
@RaghavPal
@RaghavPal 4 жыл бұрын
I will cover this, Not sure if I have done this in any later videos, I have some more Groovy sessions in SoapUI in my Udemy course
@jyothirmaisivaram8934
@jyothirmaisivaram8934 4 жыл бұрын
@@RaghavPal Do you have concepts that are not covered here in Udemy course?
@RaghavPal
@RaghavPal 4 жыл бұрын
A major part is the same, There are few Groovy Scripting sections. You can check all sections and lecture in the course Curriculum
@jyothirmaisivaram8934
@jyothirmaisivaram8934 4 жыл бұрын
@@RaghavPal Thank You
@philb4462
@philb4462 4 жыл бұрын
Thanks again for your great course. Is it possible to run a Selenium script using a Groovy step in a SoapUI test case? Do you go into that later in your video series? At work we have a step that needs to be carried out from a screen interface because there is no WSDL for it. Also, I have a specific question about something I want to do on a project for my job. Would you consider doing a one-to-one session with me? I don't think it would take very long.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Phil, You can do that, although not covered here. You can add selenium jars and then use groovy script or can also call a java jar for this.
@minuahamed632
@minuahamed632 4 жыл бұрын
Hi Raghav, I have one query.In the 'CallHello' test step , why did you write testStep.run(testRunner,Context) ? I could not understand the need for that line of code. Thanks, Minu
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Minu, log, context and testRunner are global variables and is present everytime in SoapUI. Now I may not go very deep but you can directly use them in your scripts as and when required and there are some in built syntaxes like the one above. You may check more in the documentation
@lakshmiavvaru7126
@lakshmiavvaru7126 6 жыл бұрын
Thank you so much for helping me in all the project requirements I am in
@RaghavPal
@RaghavPal 6 жыл бұрын
You're welcome Lakshmi
@angelaranda4208
@angelaranda4208 6 жыл бұрын
Hello Raghav, do you have video where you show how to put the result of a wsdl in variable, so that in another wsdl that result can be used?
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Angel, you can see this one - kzbin.info/www/bejne/fYSkpWqPhNudmLs&list=PLhW3qG5bs-L-Bt9T_bnyflQ0Te4VgFhKF Playlist - kzbin.info/aero/PLhW3qG5bs-L-Bt9T_bnyflQ0Te4VgFhKF
@ramzijelassi9535
@ramzijelassi9535 5 жыл бұрын
Thanks for the video
@RaghavPal
@RaghavPal 5 жыл бұрын
You're welcome Ramzi
@gullasridhar8720
@gullasridhar8720 Жыл бұрын
Hi sir, i have a doubts 1. If we mentioned path parameter wrong in the uri what status code we get and we mentioned wrong Query parameter what status we get, we get 404 only for both path and query parameters or we get different status code. 2. what is the main difference between Bearer token and Token generated through API
@RaghavPal
@RaghavPal Жыл бұрын
Here are the answers to your SoapUI API testing questions: 1. Status Codes for Incorrect Parameters: - Incorrect Path Parameter: - Most likely results in a 404 Not Found status code, indicating the requested resource doesn't exist at the specified path. - Incorrect Query Parameter: - Varies depending on API implementation: - Might return a 400 Bad Request status code if the parameter is invalid or essential for processing. - Could return a 404 Not Found if the parameter is crucial for resource identification. - Might ignore invalid parameters and return a 200 OK status code with potentially unexpected results. Key takeaways: - API documentation should specify expected status codes for different error scenarios. - Testing with both correct and incorrect parameters is crucial for robust API testing. 2. Differences Between Bearer Token and API-Generated Token: - Bearer Token: - Self-contained access token representing authorization to access protected resources. - Typically obtained through OAuth 2.0 or OpenID Connect flows. - Used by adding "Bearer" keyword before the token in the Authorization header. - Example: `Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...` - API-Generated Token: - Created by the API itself upon successful authentication or other actions. - Specific usage varies depending on API design: - Can be used for authorization, session management, or other purposes. - Might be included in request headers, query parameters, or body data. - Example: `Authorization: Token 1234567890abcdef` Key takeaways: - Bearer tokens are a standardized way to handle authorization in web APIs. - API-generated tokens offer flexibility for custom authentication and authorization mechanisms. - API documentation should clarify the types of tokens used and their intended usage. Additional considerations for SoapUI: - Use test steps to set appropriate headers for different token types. - Assert expected status codes to verify API behavior in response to incorrect parameters. - Leverage SoapUI's test suites and reporting features for comprehensive API testing.
@gullasridhar8720
@gullasridhar8720 Жыл бұрын
@@RaghavPal Thank you for clear cut explanation sir
@nagendran75
@nagendran75 4 жыл бұрын
Thank you Raghav, that was very useful. I've connected to the DB successfully through JDBC request and successfully retrieve the records using SQl queries.. How can I compare the response values against the DB returned values using Groovy script? Can you advise please?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Nagendran, I will plan to have a session on this. For now check - testingneeds.wordpress.com/2016/11/21/soapui-push-and-pull-data-from-database/
@nagendran75
@nagendran75 4 жыл бұрын
@@RaghavPal Thanks very much Raghav. Managed to pull the Db response. looking forward to your session.
@RaghavPal
@RaghavPal 4 жыл бұрын
Great Nagendran, it will help others if you can put your solution here
@vidhyanagi
@vidhyanagi 4 жыл бұрын
​@@RaghavPal. ​ Sure Raghav. Sorry, I missed the notification as previously commented from my husband's mobile. I've used context.expand to refer to the soap response and the JDBC request- response. Here is the example code: def soapDataItem = context.expand ('$ { teststepnameofSOAPRequest#Response#//xpathoftheproperty}') def JDBC DataItem = context.expand ('$ { teststepnameofJDBCRequest#ResponseAsXml#//xpathoftheproperty}') assert soapDataItem == JDBCDataItem
@FerozaBegum-z1i
@FerozaBegum-z1i Жыл бұрын
Hello RaghavPal, Do you have any online course where we can learn readyAPI with AWS console connection and checking cloudwatch?
@RaghavPal
@RaghavPal Жыл бұрын
Not yet on ReadyAPI Feroza
@istvan368
@istvan368 4 жыл бұрын
Raghav very thank you for all these tutorials and that you give us for free! You are the best! I also have a youtube channel where I explain different things. You are my role model. I'd like to have a question, I have written a groovy script where I read data from excel and I'd like to do that my only test case loops through the rows that are in excel. So one row in excel stores all the data for one test case and each line means a different test case, but the test case form (all the request, etc) are the same. Or in other words, I have only one test case which contains all the necessary things. It has a groovy script which reads the rows from excel and every row means a complete run of the test case. p.s. I have a soapUI project where I have setup scripts which contain a class but it doesnt contain these variables that you say the class should contain. Another question which I'd like to have at the end of the video, what is the reason of these method invocations order: project = testRunner.testCase.testSuite.project ?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi István, so glad to know this. You might have to do some custom coding for making every line a test case in excel. these are the classes and interface in soapui library. You can read api docs to get more info
@roopashreedb6149
@roopashreedb6149 4 жыл бұрын
Hi Raghav.. How to stop testcases running in infinite loop It is not stopping..it is running continuously
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Roopa, if you do not find any option on the ui, you will have to close soapui and then fix the script
@Kamal-vd1zg
@Kamal-vd1zg 5 жыл бұрын
I like the way you explain things thanks
@RaghavPal
@RaghavPal 5 жыл бұрын
You're welcome Aftab
@kambalavinodkumar1018
@kambalavinodkumar1018 4 жыл бұрын
Hello Raghav, I have written this code to execute the case, but getting null pointer exception error at statement number 4. project = testRunner.testCase.testSuite.project ; tcase = project.testSuites["TestSuite3"].testCases["TestCase2"] ; tstep = tcase.getTestStepByName("GetCountryISOCode"); def status = tstep.run(testRunner, context) def result = status.getStatus().toString(); log.info (" >>>> "+result)
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi, just check if it is running your step. There can be some syntax or spelling issue (including spaces)
@rijojohnpatric9642
@rijojohnpatric9642 3 жыл бұрын
Do we have the feature for auto suggestion, what we experience in eclipse @Raghav Pal
@RaghavPal
@RaghavPal 3 жыл бұрын
Not on the free version Rijo
@rijojohnpatric9642
@rijojohnpatric9642 3 жыл бұрын
Okay Thanks 👍
@vasuvasu7881
@vasuvasu7881 4 жыл бұрын
Hi Raghav is groovy scripting same in readyapi and soupui tools
@RaghavPal
@RaghavPal 4 жыл бұрын
Yes, ReadyAPI may have some more features like auto complete etc but you can use the same groovy scripts
@arjunms3345
@arjunms3345 5 жыл бұрын
Hello Raghav always love your videos great explanation...can you please tell me how do we make JDBC connection and do database verification in groovy...it would be really helpful... thank you
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Arjun, I will try to do a video, but can take some time. Pls get some online help meanwhile
@testingtrail
@testingtrail 6 жыл бұрын
Great tutorial, so seems to me that use of classes is more like static right? or by doing this testinit = tcase.getTestStepByName("anyclass"); you are creating an object of that type? Thanks!
@RaghavPal
@RaghavPal 6 жыл бұрын
So here a lot of inbuilt functions are provided by soapui. like getTestStepByName() is a function already available in an existing class and we can call it to get the value
@nirmalm8158
@nirmalm8158 6 жыл бұрын
Hi Ragav, Excellent presentation. Very easy to understand. Thank you! Have a doubt, which tool will be the best for Web Service Load or Performance Testing (Load UI/LoadRunner/Jmeter..etc). Thanks!
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Nirmal, it depends on the need, features, budget etc. JMeter is free and lots of online support is available. However if you need to do geographical distribution, you will need multiple systems or go with some paid services like Blazemeter. Paid tools like LoadRunner have many out of the box features. So it depends.
@mekha123
@mekha123 4 жыл бұрын
Hello, Ragav Thanks for the brilliant presentation But testStep.run(testRunner, context) not defined into hello class
@RaghavPal
@RaghavPal 4 жыл бұрын
I will check Mahmoud
@niazmaksud1139
@niazmaksud1139 5 жыл бұрын
Hi Raghav, Thanks for the video. Why are you passing testRunner and context as parameters in method testStep.run?
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Niaz, this is as per the structure of the method.
@PrashantMainaliVlogs
@PrashantMainaliVlogs 3 жыл бұрын
Hey can anyone answer that is it important to name groovyStep same name as the class itself
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Prashant, In case its related to some part in the video, pls mention the time stamp so I can check also try and check at your end
@prashantmainalimusic
@prashantmainalimusic 3 жыл бұрын
Can we call this class from a different project if yes then how?
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Prashant, not sure from a diff proj, will need to check online
@sreelathatharigonda8306
@sreelathatharigonda8306 6 жыл бұрын
its very nice video. The Groovy script which we are using in SoapUI and Jenkins pipeline script , both are the same?
@RaghavPal
@RaghavPal 6 жыл бұрын
Thanks for watching Sreelatha. Groovy script is same wherever you use it.
@saifalisanadi6519
@saifalisanadi6519 5 жыл бұрын
can u plz create video on how perform IO operation in groovy
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Saifali, I have some File I/O videos here - kzbin.info/aero/PLhW3qG5bs-L8T6v6DgsZo93DgYDmOF9u4
@shivaji288
@shivaji288 4 жыл бұрын
Hi I am getting while executing callHello groovy script java.lang.NullPointerException: cannot invoke menthod info () on null object line number 5 .
@RaghavPal
@RaghavPal 4 жыл бұрын
Pls check your code again and try to compare. What is line 5 of your code
@abhishekangrish
@abhishekangrish 5 жыл бұрын
Hello Sir, Thankyou for such great informational videos . Always follow your videos. Also please can you once upload a token handling video for Jmeter. Actually i am trying to handle dynamic tokens in Jmeter and not getting the exact results with regular expressions. I will be very thankful in case you can help me out that Groovy scripting in J meter as well.
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Abhishek, sure I will check on that session
@sreesatyatarra1810
@sreesatyatarra1810 6 жыл бұрын
As part of groovy scripting I'm unable to call 2 values from excel to do addition soap request . Please help. Its throwing error stating "org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script4.groovy: 3: unable to resolve class".
@sreesatyatarra1810
@sreesatyatarra1810 6 жыл бұрын
Its not able to recognize workbook even though i imported jxl.*
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Sreesatya , did you add excel library in bin folder and restart SoapUI
@kshitijrastogi5674
@kshitijrastogi5674 6 жыл бұрын
Hi, I am getting a null pointer exception when I try to call my method from another test case. please help..
@kshitijrastogi5674
@kshitijrastogi5674 6 жыл бұрын
Solved it..Thanks a lot :D
@RaghavPal
@RaghavPal 6 жыл бұрын
Glad to know this Kshitij
@pujanagraj7498
@pujanagraj7498 4 жыл бұрын
I'm getting java.lang.NullPointerException:Cannot invoke method sathi() on null object
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Puja where is this method sathi() coming from. Show the script
@pujanagraj7498
@pujanagraj7498 4 жыл бұрын
@@RaghavPal Is there any difference happens, if 1) Right click on Test steps>Add Step>Groovy Script 2) Right click on Test case1, in Test suite 3 as in Vedio>Addstep>Groovy Script I have done both one for class Hello and one for Calling the method, since the structure of Test suite remained same I didn't bother.
@pujanagraj7498
@pujanagraj7498 4 жыл бұрын
@@RaghavPal I had not given Global Variable in order...like, log,context,test Runner in context.setProperty, now it executed, Tqsm😊
@qentitest6005
@qentitest6005 6 жыл бұрын
Hey Raghav! Can you run python files with groovy script and can you use groovy script variable for testcase header valuer?
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi, I did not exactly got your scenario and needs. In SoapUI, we use groovy scripting. You should be able to use it and code as per your needs.
@narmadaav2967
@narmadaav2967 6 жыл бұрын
Hi Raghav , Is there a video where we can give multi data for an xml using groovy
@narmadaav2967
@narmadaav2967 6 жыл бұрын
I wanted to give multi data to single xml And wanted to take the xml automatically from any datasoruce...using soapui free version... Thanks in advance
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Narmada, pls explain your scenario in detail. An example will help
@BengaliStrings
@BengaliStrings 6 жыл бұрын
Hi Raghav, I need help with the blow can you help? Test Step Name: Read Data from Excel file Script Groovy Script Web Services Method N/A Activity 1. Read the inputs from a input.xls (define in project level property datafile) and set the values o the test case level properties x and Y 2. Run the Addition Test from groovy script 3. Fetch the result value from the response and set the fetched result value as the value to the test case level property z 4. Write the result value into the console log
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Sourav, do you need a groovy script for this. You will have to search and create it, I do not have anything handy
@BengaliStrings
@BengaliStrings 6 жыл бұрын
@@RaghavPal Thankyou Raghav Please let me know if I register for your KZbin Course will you be able to speak over chat and get help in solving codes like this , I want to learn this in details
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Sourav, due to huge no of messages, I might not be able to come over chat, but you can send me your queries and I can reply when I see them
@krishnadasari9863
@krishnadasari9863 6 жыл бұрын
how can we validate the REST request using JSON with the help of groovy script
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Krishna, you will have to get the response and then use JsonSlurper. You will get some groovy videos in this playlist - kzbin.info/aero/PLhW3qG5bs-L-Bt9T_bnyflQ0Te4VgFhKF Can take some online help as well
@prathibhab3112
@prathibhab3112 6 жыл бұрын
I get NullPointerException when I run callHello groovy... Error is at line -context.Hello.sayHello() Please help..
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Prathibha, need some logs to check this. Suggest pls see the video again to check if you missed something.
@prathibhab3112
@prathibhab3112 6 жыл бұрын
@@RaghavPal Sure Raghav..
@prathibhab3112
@prathibhab3112 6 жыл бұрын
@@RaghavPal context.setProperty("Hello", new Hello(log,context,testRunner)) - does this statement will add a custom property with the name Hello and value of the constructor to the groovy test step Hello? Because I checked my system and I did not find the custom property Hello under the groovy test step...
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Prathibha, this should not create a custom property available for user. It creates in context that will be available dynamically at runtime
@spheshoyisa3731
@spheshoyisa3731 5 жыл бұрын
I was getting NullpointerException ,because my groovy class was HelloGroovyScript but I called Hello then I changed to Hello then it worked .
@steffy007
@steffy007 6 жыл бұрын
How to re,ad excel sheet data into groovy? pls help
@RaghavPal
@RaghavPal 6 жыл бұрын
Hi Steffy, I will plan to create a tutorial on that. You can try getting some online help meanwhile. Check this stackoverflow.com/questions/46407278/how-to-get-data-from-excel-to-soapui-request community.smartbear.com/t5/SoapUI-Pro/Get-xls-data-in-loop-in-groovy-script/td-p/27864
@vipintekade6400
@vipintekade6400 5 жыл бұрын
@Automation Step by Step project =testRunner.testCase.testSuite.project; tcase = project.testSuites("TestSuite3").testCases("TestCaseName1"); hello = tcase.getTestStepByName("Hello"); hello.run(testRunner, context) context.Hello.sayHello("Vipin") For this Program i didn't got the proper output ; groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlProject.testSuites() is applicable for argument types: (java.lang.String) values: [TestSuite3] Possible solutions: getTestSuites() error at line: 2
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Vipin, you have used circular brackets (). Try using square brackets [] tcase = project.testSuites("TestSuite3").testCases("TestCaseName1");
@vipintekade3750
@vipintekade3750 5 жыл бұрын
Hi Ragav project =testRunner.testCase.testSuite.project; tcase = project.testSuites("TestSuite3").testCases("TestCaseName1"); hello = tcase.getTestStepByName("Hello"); hello.run(testRunner, context) context.Hello.sayHello("Vipin") Output : got this below error please help . groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlProject.testSuites() is applicable for argument types: (java.lang.String) values: [TestSuite3] Possible solutions: getTestSuites() error at line: 2
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Vipin, the syntax is wrong. it should be tcase = project.testSuites["TestSuite3"].testCases["TestCaseName1"] ; it is square brackets and not circular brackets
@harshsingh-uc1yf
@harshsingh-uc1yf 3 жыл бұрын
Not working for me
@RaghavPal
@RaghavPal 3 жыл бұрын
Let me know the issue with logs Harsh
@anitha3469
@anitha3469 5 жыл бұрын
how to write this in a single line? project = testRunner.testCase.testSuite.project ; tcase = project.testSuites["TestSuite3"].testCases["TestCase1"] ; hello = tcase.getTestStepByName("Hello");
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Anitha, I believe I replied to a similar question earlier. Just try to combine these like hello = testRunner.testCase.testSuite.project.testSuites["TestSuite3"].testCases["TestCase1"].getTestStepByName("Hello")
@balpreetsingh217
@balpreetsingh217 4 жыл бұрын
I got confused by listening "Hello" multiple times.
@RaghavPal
@RaghavPal 4 жыл бұрын
Sorry for that Balpreet
All The JavaScript You Need To Know For React
28:00
PedroTech
Рет қаралды 694 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
Gradle Course for Beginners | Get Going with Gradle
56:59
Tom Gregory
Рет қаралды 40 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1,1 МЛН
SoapUI Beginner Tutorial 6 - How to Get and Set Properties through GROOVY scripts
18:56
5 Secrets to Stop Stuttering & Speak More Clearly!
12:44
Vinh Giang
Рет қаралды 140 М.
Webinar: An introduction to Groovy scripting - write your very first script
55:10
SoapUI Beginner Tutorial 7 - How to do Property Transfer | Values Transfer
10:55
Automation Step by Step
Рет қаралды 74 М.
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,3 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН