Katalon Studio | How to use Variables

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ย. 2024

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

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

    Could you please provide a video on how to use Authorization in Katlaon Studio

  • @joshuawrixon2767
    @joshuawrixon2767 2 ปีที่แล้ว

    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

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

      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

  • @Doggies12390
    @Doggies12390 2 ปีที่แล้ว

    I want to know in katalon how to write webelement method is displayed is enabled in the if condition

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

      Hi Shubham, did not get you exactly, will need more details and example

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

    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.

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

      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

  • @sharmilahdevi5584
    @sharmilahdevi5584 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 ?

    • @RaghavPal
      @RaghavPal  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

  • @nabilahasyim9728
    @nabilahasyim9728 ปีที่แล้ว

    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

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

      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

  • @thanhproo1412
    @thanhproo1412 2 ปีที่แล้ว

    thanks.
    Do you have video list about Katalon Studio course?

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

      Hi Thanh ,Can check here - automationstepbystep.com/

    • @thanhproo1412
      @thanhproo1412 2 ปีที่แล้ว

      @@RaghavPal thank you

  • @abhishekarora2831
    @abhishekarora2831 6 ปีที่แล้ว

    Hi raghav...on launching the site on katalon...i m getting error Invalid argument socket ..cud u pls help me out ?

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

      Hi Abhishek, what is the site, any more logs you have

    • @abhishekarora2831
      @abhishekarora2831 6 ปีที่แล้ว

      Raghav i have send you snapshot on your mail id..pls check..

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

      sure Abhishek

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

    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?

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

      Hi, I will have to see the details and logs to troubleshoot

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

    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
      @RaghavPal  5 ปีที่แล้ว

      Hi Ashwani,
      You can use
      GlobalVariable.name = 'abc123'
      This will set a global variable name = abc123

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

      @@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

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

      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.

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

      @@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.

  • @SandeepSharma-wx9pu
    @SandeepSharma-wx9pu 4 ปีที่แล้ว

    Hello, what is "Test Data Value" variable type in Katalon?

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

      Hi Sandeep, this is to refer variables from a data file

    • @SandeepSharma-wx9pu
      @SandeepSharma-wx9pu 4 ปีที่แล้ว

      @@RaghavPal thanks very much...

  • @swatimore-hq4dy
    @swatimore-hq4dy ปีที่แล้ว

    hi raghaw,, how to handle otp ? and third party gmail auth varification.

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

      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

    • @swatimore-hq4dy
      @swatimore-hq4dy ปีที่แล้ว

      @@RaghavPal is it applicable for mobile application?

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

      will need to check some examples

  • @waniya-huzzu
    @waniya-huzzu 6 ปีที่แล้ว

    Hi raghav, What is SDET , how a normal automation tester will become SDET?

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

      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

    • @waniya-huzzu
      @waniya-huzzu 6 ปีที่แล้ว

      Thanks for your reply reghav, how i can develop skill as SDET?

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

      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

    • @waniya-huzzu
      @waniya-huzzu 6 ปีที่แล้ว

      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?

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

      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.

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

    Hi , How can I assign script level variable to Global variable?

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

      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"

  • @RudyFrancoFloresDelgado
    @RudyFrancoFloresDelgado 6 ปีที่แล้ว

    I have problems with input type="number". I can't set the value

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

      Hi Rudy, not sure why is this so, Do you have any logs

    • @RudyFrancoFloresDelgado
      @RudyFrancoFloresDelgado 6 ปีที่แล้ว +1

      Automation Step by Step - Raghav Pal Hi Raghav, I resolved it using getAttribute method instead getText Method. Thanks.

  • @kajaanusha4790
    @kajaanusha4790 6 หลายเดือนก่อน

    How to automate calendar for dynamic dates

    • @RaghavPal
      @RaghavPal  6 หลายเดือนก่อน

      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.
      ..

    • @kajaanusha4790
      @kajaanusha4790 6 หลายเดือนก่อน

      @@RaghavPal for mobile application also is it applicable same

    • @RaghavPal
      @RaghavPal  6 หลายเดือนก่อน

      the basic steps will be the same...
      will need to check the elements present..

    • @kajaanusha4790
      @kajaanusha4790 6 หลายเดือนก่อน

      @@RaghavPal thank you

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

    how can to add the global Variables component ?

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

      Hi Juan, did not get you. What exactly is the scenario

  • @shivarajp2714
    @shivarajp2714 2 ปีที่แล้ว

    Hi Sir, I wanted to add global variables in Authorization fileds ,Could you please help on this..@API testing

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

      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