Hi, Do you have any videos that demonstrate how to use the snippets for 'Get a variable' and 'Get a global variable (I've tried searching but haven't come across anything so far)? If not, would it be possible to respond with an example of what information you would need to add to each snippet please? GlobalVariable.variable def variables = request.getVariables() def variable = variables.get('yourVariableName') Thank you
Hi Joshua, you can get global var using GlobalVariable.varName some links docs.katalon.com/katalon-studio/docs/variable-types.html#test-case-variables docs.katalon.com/katalon-studio/docs/execution-profile-v54.html#update-global-variables-during-runtime
How can I store the order # when I make an order online into a variable since this order # will be different every time a new order is created? I also want to know how can I do the following: Your order number is (whatever the case is). Thanks for your help.
Hi Emmanuel, You can either get order no from an external file like excel or csv. Or if you can have a random order no can use functions to generate random numbers forum.katalon.com/t/how-do-i-set-a-random-number-in-a-text-field/10598/4
Hi Sharmilah, Any login on browser can be handled. In case you need to do windows authentication Check - forum.katalon.com/t/is-there-any-way-to-fill-in-windows-authentication-forms-with-kantalon/5983
Hi sir, is there any ways to make encryption test as variable? i would like to test views test cases in Password field (encryptiontext). Please help, thank you
you can do that, can add and refer variables from the variables tab and also from external file like csv, Just that you will need to provide the encrypted value for the variable
Hello! Thanks for this video. I'm having difficulty using variables within the Execute Javascript context. Do you know what the syntax is to make things work there?
Thanks for the video. Very helpful. But I am stuck with a scenario where I want to set 'test variable' or 'global variable' on the fly while running the test case. e.g: After the test run, resultvalue1 = 'abc123' , now I want to set this value in the variables tab or in the global variables via some script or some keyword. I tried all possible ways but could't succeed. Please if you can help, that will be highly appreciable.
@@RaghavPal Hi , thx 4 the videos. I have a question and I think Im not the only one. If I set global variable in one test case like here "abc123" via script, and then start another t case (in the same env) and call the global variable, it has its default value not "abc123". What is the point of the global value then,? :D
Hi, if you have a global variable say ID and then a variable in your test script with the same name ID, then it will override the value from global variable.
@@RaghavPal Hi, i have tried declaring global value like this "GlobalVariable.cookie = slicedCookiez" but it does not store the value. And when i try to use the value in another test case it throws an error saying that there is no value in variable. However i see the value when printing the slicedCookiez in the 1st test case.
Hi Swati, To handle OTP in Katalon Studio, you can use the following steps: Launch the application and perform the actions that lead to the OTP screen. Use the getText() method to get the OTP from the screen. Use the sendKeys() method to enter the OTP in the appropriate field. For example, assuming that the OTP is displayed in a text field with the locator id="otp": // Get the OTP text String otp = WebUI.getText(findTestObject('Object Repository/OTP Field')) // Enter the OTP WebUI.sendKeys(findTestObject('Object Repository/OTP Field'), otp) To handle third-party Gmail authentication verification, you can use the WebUI.switchToWindowIndex() method to switch to the new window that contains the Gmail authentication screen. Once you are on the Gmail authentication screen, you can enter the credentials and perform the verification. Once verification is complete, you can switch back to the original window using the same method. For example, assuming that the Gmail authentication window opens in a new tab with the index 1: // Switch to the new window WebUI.switchToWindowIndex(1) // Enter credentials and perform verification // Switch back to the original window WebUI.switchToWindowIndex(0) You can find more information about handling windows and frames in Katalon Studio in the official documentation: docs.katalon.com/katalon-studio/docs/working-with-windows-and-frames.html
Hi Azharuddin, SDET - Software Development Engineer in Test. Person with this role has both dev and testing skills and can contribute in multiple phases of the product development. So they can leverage their coding skills and help in test automation Can do unit test creation Helps in creating a bridge between dev and testing teams
I am currently working as Automation Tester using selenium and java, but do not have dev experience. How i can improve on dev skills? Can you suggest something as a starting point?
If you are already into Automation Testing, there is a great scope. I will suggest that increase your skill set in automation. Learn more tools and framework.
Hi Shiva, If you have a global variable say GVariable1 and you have a local script variable say LVariable1, Now if you want to update value of GVariable1 equal to the value of LVariable1 in the script tab of test case you can write GlobalVariables.GVariable1 = LVariable1 or directly assign value GlobalVariables.GVariable1 = "xyz"
Automating dynamic dates in a calendar using Katalon Studio involves a few steps. Let's break it down: 1. Identify the Calendar Element: - First, locate the calendar element on your web page. It could be an input field or a button that triggers the calendar popup. 2. Select a Date: - You'll need to choose a date from the calendar. Since the dates are dynamic, you can't hardcode them. - Use Katalon's built-in DateUtil class to work with dates. It provides methods for date manipulation. 3. Calculate the Target Date: - Depending on your use case, calculate the target date dynamically. For example: - If you need to select tomorrow's date: `DateUtil.addDays(DateUtil.getToday(), 1)` - If you need to select a date after a specific number of days: `DateUtil.addDays(DateUtil.getToday(), numberOfDays)` 4. Enter the Date into the Calendar Field: - Use Katalon's WebUI.setText or WebUI.sendKeys to input the calculated date into the calendar field. 5. Validate the Selected Date: - After entering the date, verify that the correct date is displayed in the calendar. 6. Trigger the Date Selection: - If the calendar requires a separate action (like clicking a "Submit" button), perform that action. Here's a sample Katalon Studio script snippet to automate selecting tomorrow's date: ```groovy import com.kms.katalon.core.util.DateUtil import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI // Assume 'calendarInput' is the ID or XPath of your calendar input field def calendarInput = 'your-calendar-input-id-or-xpath' // Calculate tomorrow's date def tomorrow = DateUtil.addDays(DateUtil.getToday(), 1) // Enter the date into the input field WebUI.setText(findTestObject('your-calendar-input-object'), DateUtil.toString(tomorrow, 'MM/dd/yyyy')) // Validate the selected date (optional) // ... // Trigger any necessary actions (e.g., click 'Submit') // ... ``` Remember to replace `'your-calendar-input-id-or-xpath'` with the actual locator for your calendar input field. ..
Hi Shivaraj, you can do this 1. add a variable in Profiles (Global Variable) 2. add a local variable (in the variables tab) 3. In the value type dropdown select Global Variable and for the value select the global variable created in Step 1 4. Now refer this local variable in your test/request
Could you please provide a video on how to use Authorization in Katlaon Studio
I will plan
Hi,
Do you have any videos that demonstrate how to use the snippets for 'Get a variable' and 'Get a global variable (I've tried searching but haven't come across anything so far)?
If not, would it be possible to respond with an example of what information you would need to add to each snippet please?
GlobalVariable.variable
def variables = request.getVariables()
def variable = variables.get('yourVariableName')
Thank you
Hi Joshua,
you can get global var using
GlobalVariable.varName
some links
docs.katalon.com/katalon-studio/docs/variable-types.html#test-case-variables
docs.katalon.com/katalon-studio/docs/execution-profile-v54.html#update-global-variables-during-runtime
I want to know in katalon how to write webelement method is displayed is enabled in the if condition
Hi Shubham, did not get you exactly, will need more details and example
How can I store the order # when I make an order online into a variable since this order # will be different every time a new order is created? I also want to know how can I do the following: Your order number is (whatever the case is). Thanks for your help.
Hi Emmanuel, You can either get order no from an external file like excel or csv. Or if you can have a random order no can use functions to generate random numbers forum.katalon.com/t/how-do-i-set-a-random-number-in-a-text-field/10598/4
Hi please need a help how if my website have a security and I have to enter credentials to see the website..how to use is in katalon ?
Hi Sharmilah, Any login on browser can be handled. In case you need to do windows authentication Check - forum.katalon.com/t/is-there-any-way-to-fill-in-windows-authentication-forms-with-kantalon/5983
Hi sir, is there any ways to make encryption test as variable? i would like to test views test cases in Password field (encryptiontext). Please help, thank you
you can do that, can add and refer variables from the variables tab and also from external file like csv, Just that you will need to provide the encrypted value for the variable
thanks.
Do you have video list about Katalon Studio course?
Hi Thanh ,Can check here - automationstepbystep.com/
@@RaghavPal thank you
Hi raghav...on launching the site on katalon...i m getting error Invalid argument socket ..cud u pls help me out ?
Hi Abhishek, what is the site, any more logs you have
Raghav i have send you snapshot on your mail id..pls check..
sure Abhishek
Hello! Thanks for this video. I'm having difficulty using variables within the Execute Javascript context. Do you know what the syntax is to make things work there?
Hi, I will have to see the details and logs to troubleshoot
Thanks for the video. Very helpful. But I am stuck with a scenario where I want to set 'test variable' or 'global variable' on the fly while running the test case.
e.g: After the test run, resultvalue1 = 'abc123' , now I want to set this value in the variables tab or in the global variables via some script or some keyword.
I tried all possible ways but could't succeed. Please if you can help, that will be highly appreciable.
Hi Ashwani,
You can use
GlobalVariable.name = 'abc123'
This will set a global variable name = abc123
@@RaghavPal Hi , thx 4 the videos. I have a question and I think Im not the only one. If I set global variable in one test case like here "abc123" via script, and then start another t case (in the same env) and call the global variable, it has its default value not "abc123". What is the point of the global value then,? :D
Hi, if you have a global variable say ID and then a variable in your test script with the same name ID, then it will override the value from global variable.
@@RaghavPal Hi, i have tried declaring global value like this "GlobalVariable.cookie = slicedCookiez" but it does not store the value. And when i try to use the value in another test case it throws an error saying that there is no value in variable.
However i see the value when printing the slicedCookiez in the 1st test case.
Hello, what is "Test Data Value" variable type in Katalon?
Hi Sandeep, this is to refer variables from a data file
@@RaghavPal thanks very much...
hi raghaw,, how to handle otp ? and third party gmail auth varification.
Hi Swati,
To handle OTP in Katalon Studio, you can use the following steps:
Launch the application and perform the actions that lead to the OTP screen.
Use the getText() method to get the OTP from the screen.
Use the sendKeys() method to enter the OTP in the appropriate field.
For example, assuming that the OTP is displayed in a text field with the locator id="otp":
// Get the OTP text
String otp = WebUI.getText(findTestObject('Object Repository/OTP Field'))
// Enter the OTP
WebUI.sendKeys(findTestObject('Object Repository/OTP Field'), otp)
To handle third-party Gmail authentication verification, you can use the WebUI.switchToWindowIndex() method to switch to the new window that contains the Gmail authentication screen. Once you are on the Gmail authentication screen, you can enter the credentials and perform the verification. Once verification is complete, you can switch back to the original window using the same method.
For example, assuming that the Gmail authentication window opens in a new tab with the index 1:
// Switch to the new window
WebUI.switchToWindowIndex(1)
// Enter credentials and perform verification
// Switch back to the original window
WebUI.switchToWindowIndex(0)
You can find more information about handling windows and frames in Katalon Studio in the official documentation: docs.katalon.com/katalon-studio/docs/working-with-windows-and-frames.html
@@RaghavPal is it applicable for mobile application?
will need to check some examples
Hi raghav, What is SDET , how a normal automation tester will become SDET?
Hi Azharuddin,
SDET - Software Development Engineer in Test.
Person with this role has both dev and testing skills and can contribute in multiple phases of the product development.
So they can leverage their coding skills and help in test automation
Can do unit test creation
Helps in creating a bridge between dev and testing teams
Thanks for your reply reghav, how i can develop skill as SDET?
Generally a person in dev profile can make a good SDET, so if you can get skills on dev or work in dev for sometime, it will be helpful for SDET role
I am currently working as Automation Tester using selenium and java, but do not have dev experience. How i can improve on dev skills? Can you suggest something as a starting point?
If you are already into Automation Testing, there is a great scope. I will suggest that increase your skill set in automation. Learn more tools and framework.
Hi , How can I assign script level variable to Global variable?
Hi Shiva, If you have a global variable say GVariable1 and you have a local script variable say LVariable1, Now if you want to update value of GVariable1 equal to the value of LVariable1 in the script tab of test case you can write
GlobalVariables.GVariable1 = LVariable1
or directly assign value
GlobalVariables.GVariable1 = "xyz"
I have problems with input type="number". I can't set the value
Hi Rudy, not sure why is this so, Do you have any logs
Automation Step by Step - Raghav Pal Hi Raghav, I resolved it using getAttribute method instead getText Method. Thanks.
How to automate calendar for dynamic dates
Automating dynamic dates in a calendar using Katalon Studio involves a few steps. Let's break it down:
1. Identify the Calendar Element:
- First, locate the calendar element on your web page. It could be an input field or a button that triggers the calendar popup.
2. Select a Date:
- You'll need to choose a date from the calendar. Since the dates are dynamic, you can't hardcode them.
- Use Katalon's built-in DateUtil class to work with dates. It provides methods for date manipulation.
3. Calculate the Target Date:
- Depending on your use case, calculate the target date dynamically. For example:
- If you need to select tomorrow's date: `DateUtil.addDays(DateUtil.getToday(), 1)`
- If you need to select a date after a specific number of days: `DateUtil.addDays(DateUtil.getToday(), numberOfDays)`
4. Enter the Date into the Calendar Field:
- Use Katalon's WebUI.setText or WebUI.sendKeys to input the calculated date into the calendar field.
5. Validate the Selected Date:
- After entering the date, verify that the correct date is displayed in the calendar.
6. Trigger the Date Selection:
- If the calendar requires a separate action (like clicking a "Submit" button), perform that action.
Here's a sample Katalon Studio script snippet to automate selecting tomorrow's date:
```groovy
import com.kms.katalon.core.util.DateUtil
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
// Assume 'calendarInput' is the ID or XPath of your calendar input field
def calendarInput = 'your-calendar-input-id-or-xpath'
// Calculate tomorrow's date
def tomorrow = DateUtil.addDays(DateUtil.getToday(), 1)
// Enter the date into the input field
WebUI.setText(findTestObject('your-calendar-input-object'), DateUtil.toString(tomorrow, 'MM/dd/yyyy'))
// Validate the selected date (optional)
// ...
// Trigger any necessary actions (e.g., click 'Submit')
// ...
```
Remember to replace `'your-calendar-input-id-or-xpath'` with the actual locator for your calendar input field.
..
@@RaghavPal for mobile application also is it applicable same
the basic steps will be the same...
will need to check the elements present..
@@RaghavPal thank you
how can to add the global Variables component ?
Hi Juan, did not get you. What exactly is the scenario
Hi Sir, I wanted to add global variables in Authorization fileds ,Could you please help on this..@API testing
Hi Shivaraj, you can do this
1. add a variable in Profiles (Global Variable)
2. add a local variable (in the variables tab)
3. In the value type dropdown select Global Variable and for the value select the global variable created in Step 1
4. Now refer this local variable in your test/request