Hi mr.raghav,today I watched your vedios .your way of teaching is simply superb. Can u pls make a vedios like drag and drop and searching the specified ones in search bar.thank u
Hi Raghav, How to call method from 1 test case to other? I have Firts Test case with method 1 and method 2 I want to use method 2 in my send test case. I don't want to use custom keywords as I need only method 2. Please help! Thanks
Neha There are two main ways to call methods from one test case to another in Katalon Studio without using custom keywords: **Method 1: Using the 'Call Test Case' keyword** The 'Call Test Case' keyword allows you to execute one test case from within another test case. To use this method, follow these steps: 1. In your first test case, identify the method you want to call from the second test case. 2. In your second test case, add the following step: ``` WebUI.callTestCase(findTestCase('Second Test Case')) ``` This step will execute the second test case, and any methods within that test case will be available for execution. 3. To call the specific method you want, use the following syntax: ``` TestObject secondTestCase = findTestCase('Second Test Case') secondTestCase.callMethod('method2') ``` This will call the 'method2' method from the second test case. **Method 2: Using the 'Import Test Case' keyword** The 'Import Test Case' keyword allows you to import the methods from another test case into your current test case. To use this method, follow these steps: 1. In your first test case, identify the methods you want to import into the second test case. 2. In your second test case, add the following step: ``` WebUI.importTestCase(findTestCase('First Test Case')) ``` This step will import the methods from the first test case into your current test case. 3. Once the methods have been imported, you can call them directly using the following syntax: ``` firstTestCase.method2() ``` This will call the 'method2' method from the first test case. Both of these methods will allow you to call methods from one test case to another in Katalon Studio without having to create custom keywords. The method you choose will depend on your specific needs and preferences. I hope this helps
Hi Raghav, nice colletions of katalon studio videos, there are asome, i have a question, for you or community, i need to create a MOBILE keyword because i need to copy a text and then paste a text inn Android APP, can you help me, thanks
Gionathan In Katalon Studio, you can create custom keywords to perform specific actions like copying and pasting text within an Android app. Here's a step-by-step guide to help you create a MOBILE keyword for this purpose: 1. Define the Custom Keyword: - Go to Keywords in your Katalon Studio project. - Right-click and choose New > Keyword. - Provide a name for your keyword, such as `CopyAndPasteText`, and click OK. 2. Implement the Keyword: - Open the newly created keyword file. - Write a method that uses the `Mobile.getText()` to extract text and `Mobile.setText()` to paste it. - Here's an example of how the code might look: ```groovy package com.yourcompany import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile import com.kms.katalon.core.model.FailureHandling import com.kms.katalon.core.testobject.TestObject import io.appium.java_client.MobileElement import io.appium.java_client.android.AndroidDriver public class CopyAndPasteText { / * Copy text from one element and paste it into another. * @param fromElement TestObject to copy text from. * @param toElement TestObject to paste text into. */ @Keyword def copyAndPasteText(TestObject fromElement, TestObject toElement) { // Get the driver AndroidDriver driver = MobileDriverFactory.getDriver() // Get text from the 'fromElement' String textToCopy = Mobile.getText(fromElement, FailureHandling.STOP_ON_FAILURE) // Set text to the 'toElement' Mobile.setText(toElement, textToCopy, FailureHandling.STOP_ON_FAILURE) } } ``` 3. Use the Keyword in Your Test Case: - In your test case, call the custom keyword with the appropriate TestObjects. - For example: ```groovy import com.yourcompany.CopyAndPasteText // Define your TestObjects TestObject fromElement = findTestObject('path/to/your/fromElement') TestObject toElement = findTestObject('path/to/your/toElement') // Use the custom keyword CopyAndPasteText customKeyword = new CopyAndPasteText() customKeyword.copyAndPasteText(fromElement, toElement) ``` Make sure to replace `'path/to/your/fromElement'` and `'path/to/your/toElement'` with the actual paths to your TestObjects in the Object Repository. This is a simplified example, and you may need to adjust the code based on the specifics of your application and testing needs. For more detailed information, you can refer to the [Katalon documentation](^1^) on custom keywords and mobile testing commands. Remember to handle any exceptions and ensure that your elements are correctly identified in the Object Repository. Happy testing
Hi Raghav, Do you know how to call one custom keyword method to another custom keyword method. Eg: I ahev created ABC method in alfha custom keyword and need to call that ABC in beta custom keyword of XZY method.
@Automation Step by Step: Raghav I would like to create custom keywords for GET, POST, PUT, DELETE, PATCH methods without using Object repository. I want to quit using ObjRepo since maintaining is becoming difficult. Is it possible? Please help me out
@@RaghavPal Raghav , what is happening is for each method I need to use authorization. So if the Authorization token (variable which I am using is ${token}) expires then the TC is failing. I have written a custom keyword script for authorization. and using it in the test case. The bearer token value I am storing in a global variable but somehow it is not getting picked up in objrepo. So I have to manually add the token value from postman to make the TC run. Can u help me with this? Also, i am trying to print the response, I see that the token value is running but it's not getting printed in test case
@Automation Step by Step : Raghav, Please help me in setting up Keywords for API tsting. Is there any video which you have made specific for API? Have you made any video for Authorization as well?Please let me know
@@RaghavPal : Hi Raghav, can u please help me with writing this bearer auth token script in custom keyword. No matter what I am trying, i am not able to get it to execute
Hi Raghav, Thanks for Videos. Can you please make a detailed video on Utilities keyword mentioned below for WEB Testing. Utilities [Common] Comment [Common] Concatenate Common Assertions (Soft Assetion) [Common] Verify Equal [Common] Verify Greater Than [Common] Verify Greater Than Or Equal [Common] Verify Less Than [Common] Verify Less Than Or Equal [Common] Verify Match [Common] Verify Not Equal [Common] Verify Not Match
Hi Raghav, I'm learning a lot from your videos. One question, is it possible to call an ADB command for mobile app using custom keywords? Can you also make a video for it. That would be very helpful. Thanks :)
calling custom keyword inside another custom keyword is working with this code (new “packagename”.“classname”()).“methodname”() But how to pass values If 1st custom keyword has @keyword def method name (string value) Pls guide me
Hi Raghav Thanks fro video. But i actually i wanted. There was a keyword created by my team which i wanted to import into my project. I even imported successfully but i need to add some object which i don't understand what kind of object is expected.
Hi Raghav, thank you for this video. For writing any custom keyword we need to learn the groovy language.
Hi Pallishree, basic knowledge should be good to start, you can also find many examples online
Hi mr.raghav,today I watched your vedios .your way of teaching is simply superb. Can u pls make a vedios like drag and drop and searching the specified ones in search bar.thank u
So happy & humbled to know this Chandrika, I will do
Love your videos thank you!
Most welcome
Hi Raghav,
How to call method from 1 test case to other?
I have Firts Test case with method 1 and method 2
I want to use method 2 in my send test case.
I don't want to use custom keywords as I need only method 2.
Please help! Thanks
Neha
There are two main ways to call methods from one test case to another in Katalon Studio without using custom keywords:
**Method 1: Using the 'Call Test Case' keyword**
The 'Call Test Case' keyword allows you to execute one test case from within another test case. To use this method, follow these steps:
1. In your first test case, identify the method you want to call from the second test case.
2. In your second test case, add the following step:
```
WebUI.callTestCase(findTestCase('Second Test Case'))
```
This step will execute the second test case, and any methods within that test case will be available for execution.
3. To call the specific method you want, use the following syntax:
```
TestObject secondTestCase = findTestCase('Second Test Case')
secondTestCase.callMethod('method2')
```
This will call the 'method2' method from the second test case.
**Method 2: Using the 'Import Test Case' keyword**
The 'Import Test Case' keyword allows you to import the methods from another test case into your current test case. To use this method, follow these steps:
1. In your first test case, identify the methods you want to import into the second test case.
2. In your second test case, add the following step:
```
WebUI.importTestCase(findTestCase('First Test Case'))
```
This step will import the methods from the first test case into your current test case.
3. Once the methods have been imported, you can call them directly using the following syntax:
```
firstTestCase.method2()
```
This will call the 'method2' method from the first test case.
Both of these methods will allow you to call methods from one test case to another in Katalon Studio without having to create custom keywords. The method you choose will depend on your specific needs and preferences.
I hope this helps
Hi Raghav, nice colletions of katalon studio videos, there are asome, i have a question, for you or community, i need to create a MOBILE keyword because i need to copy a text and then paste a text inn Android APP, can you help me, thanks
Gionathan
In Katalon Studio, you can create custom keywords to perform specific actions like copying and pasting text within an Android app. Here's a step-by-step guide to help you create a MOBILE keyword for this purpose:
1. Define the Custom Keyword:
- Go to Keywords in your Katalon Studio project.
- Right-click and choose New > Keyword.
- Provide a name for your keyword, such as `CopyAndPasteText`, and click OK.
2. Implement the Keyword:
- Open the newly created keyword file.
- Write a method that uses the `Mobile.getText()` to extract text and `Mobile.setText()` to paste it.
- Here's an example of how the code might look:
```groovy
package com.yourcompany
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testobject.TestObject
import io.appium.java_client.MobileElement
import io.appium.java_client.android.AndroidDriver
public class CopyAndPasteText {
/
* Copy text from one element and paste it into another.
* @param fromElement TestObject to copy text from.
* @param toElement TestObject to paste text into.
*/
@Keyword
def copyAndPasteText(TestObject fromElement, TestObject toElement) {
// Get the driver
AndroidDriver driver = MobileDriverFactory.getDriver()
// Get text from the 'fromElement'
String textToCopy = Mobile.getText(fromElement, FailureHandling.STOP_ON_FAILURE)
// Set text to the 'toElement'
Mobile.setText(toElement, textToCopy, FailureHandling.STOP_ON_FAILURE)
}
}
```
3. Use the Keyword in Your Test Case:
- In your test case, call the custom keyword with the appropriate TestObjects.
- For example:
```groovy
import com.yourcompany.CopyAndPasteText
// Define your TestObjects
TestObject fromElement = findTestObject('path/to/your/fromElement')
TestObject toElement = findTestObject('path/to/your/toElement')
// Use the custom keyword
CopyAndPasteText customKeyword = new CopyAndPasteText()
customKeyword.copyAndPasteText(fromElement, toElement)
```
Make sure to replace `'path/to/your/fromElement'` and `'path/to/your/toElement'` with the actual paths to your TestObjects in the Object Repository.
This is a simplified example, and you may need to adjust the code based on the specifics of your application and testing needs. For more detailed information, you can refer to the [Katalon documentation](^1^) on custom keywords and mobile testing commands.
Remember to handle any exceptions and ensure that your elements are correctly identified in the Object Repository.
Happy testing
Dear Raghav,
your videos are very useful to my QA team and thanks for your tutorials.
Glad to hear that Palanivel, can find all here - automationstepbystep.com/
@@RaghavPal noted it. thanks, Raghav
Hi Raghav, Do you know how to call one custom keyword method to another custom keyword method. Eg: I ahev created ABC method in alfha custom keyword and need to call that ABC in beta custom keyword of XZY method.
Hi Shilpi, have you tried doing the call in the keyword function, I believe this should be doable
Hi Raghav, can you make a video on how to use the getHtmlTableRows (kustomkayword)and also how to use fiendElements methods in Katalon Studio.
I will try to do a session Abdul
@@RaghavPal Thank a lot ......
@@RaghavPal Hi Raghav, Please make a video waiting for this video
@@RaghavPal Hi Raghav, waiting for your session
@@RaghavPal Hi Raghav, waiting for your response....... it's humble request.
Thank you :) Greeting from Colombia
You are welcome!
@Automation Step by Step: Raghav I would like to create custom keywords for GET, POST, PUT, DELETE, PATCH methods without using Object repository. I want to quit using ObjRepo since maintaining is becoming difficult. Is it possible? Please help me out
Hi Shanthi, you can do, will need to write code for it. In the Object Repository you can create sub-folders for easy maintenance
@@RaghavPal Raghav , what is happening is for each method I need to use authorization. So if the Authorization token (variable which I am using is ${token}) expires then the TC is failing.
I have written a custom keyword script for authorization. and using it in the test case. The bearer token value I am storing in a global variable but somehow it is not getting picked up in objrepo. So I have to manually add the token value from postman to make the TC run. Can u help me with this? Also, i am trying to print the response, I see that the token value is running but it's not getting printed in test case
will check on this scenario
@Automation Step by Step : Raghav, Please help me in setting up Keywords for API tsting. Is there any video which you have made specific for API?
Have you made any video for Authorization as well?Please let me know
Hi Shanthi, yes, you can check this th-cam.com/play/PLhW3qG5bs-L-yy1HtdxKcp-blmG5qeWgg.html
@@RaghavPal : Hi Raghav, can u please help me with writing this bearer auth token script in custom keyword. No matter what I am trying, i am not able to get it to execute
Can we create custom keywords using java instead of groovy ? If so can you share video ?
Hi Waheed, you can use java jar in katalon studio, For scripting within katalon you will need to use groovy
Hi Raghav, Thanks for Videos. Can you please make a detailed video on Utilities keyword mentioned below for WEB Testing.
Utilities
[Common] Comment
[Common] Concatenate
Common Assertions (Soft Assetion)
[Common] Verify Equal
[Common] Verify Greater Than
[Common] Verify Greater Than Or Equal
[Common] Verify Less Than
[Common] Verify Less Than Or Equal
[Common] Verify Match
[Common] Verify Not Equal
[Common] Verify Not Match
Hi, sure I will check it soon
Hi ragav,
I am using file upload function for uploading the PDF, it's not uploading it, could you please provide solution for it?
Hi Vinay, what do you get in logs
@@RaghavPal
Thankyou for reply.
I am getting file not interactable
will check on this
Hi Raghav, I'm learning a lot from your videos. One question, is it possible to call an ADB command for mobile app using custom keywords? Can you also make a video for it. That would be very helpful. Thanks :)
Hi, you should be able to. I will check on that
Thank you sir! :)
You're welcome John
Nice video Raghav.... Can you tell me why Katalon not allowing to call keyword if it is writen in Java instead groovy?
Hi Hari, believe it supports groovy. You can also put this on katalon forum to get more insights
calling custom keyword inside another custom keyword is working with this code
(new “packagename”.“classname”()).“methodname”()
But how to pass values
If 1st custom keyword has
@keyword
def method name (string value)
Pls guide me
What is the error Divishree, will need some time to check on this
i want to know how to compare two paragraph content in katlon. can you help me with that?
Hi Saraz, you can verify match on 2 strings using docs.katalon.com/katalon-studio/docs/common-verify-match.html#description-
Thanks Raghav.... 👏 could you please please tell how to integrate ngwebdriver with Katalon Studio.
Hi Nazeer, Katalon Studio has keywords to handle Angular elements, try using them
Hi Raghav Thanks fro video. But i actually i wanted. There was a keyword created by my team which i wanted to import into my project. I even imported successfully but i need to add some object which i don't understand what kind of object is expected.
Hi Tomasz, can you show me the scripting of the keyword.
Hey, can you make a video about Checkpoints?
Hi, sure, I had already created it, Will be available tomorrow.
Ah, cool!
Great feature, thanks for the video!
i can't see the keyword annotation in the drop down menu plz hlp
Hi, hope you are talking about the auto suggestion drop down. You can start typing and then press Ctrl+Space
Hi Dear
i have a API web service with JavaScript pre request how can i handle it ?
Hi Faryooz, I will need to see some example
@@RaghavPal sure , i text u in linkedin since i'm not able to upload img here
@@RaghavPal if there is any other place to share with u the details please let me know
can upload on a shared url and send me
@@RaghavPal drive.google.com/file/d/1OFncd6IRQLnm_3PSMC8dW_6zLwt_ty94/view?usp=drivesdk