Get your 6-month No-Cost Opt-Out offer for Unlimited software automation!

Adding Strings Within a String

Adding Strings Within a String

Home Forums Ask Expert Suggestion Box Adding Strings Within a String

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #74686
    Antonia Alleyne
    Participant

      I want to be able to have ZapTest type out “” but I am not sure how to do that. I tried using escaped characters, but that does not as well. I am using JavaScript. I attached a screenshot of what I am attempted to do. Any help would be greatly appreciated.

      #74688
      Sasha ZAP
      Moderator

        Hello Antonia Alleyne,
        As I understood you wish the string “Long Axis” will appear with quotes, if this is correct then the answer is:
        Application(“Expert Window”).View(“Dev Console”).Object(“Enter command”).Type(“sensor.probe-override-window-name “Long Axis”test “);
        Thanks,
        ZAPTEST Team

        • This reply was modified 3 months, 3 weeks ago by Sasha ZAP.
        • This reply was modified 3 months, 3 weeks ago by Sasha ZAP.
        #74691
        Sasha ZAP
        Moderator

          Hello
          I see the code cannot be saved in the Forum as in ZAPTEST, so I’ve attached it as a screenshot.

          P.S. If you cannot open the attached screenshot please use this URL to view it:
          https://drive.google.com/file/d/1qp95HvRkr88lZzYKgPFDm3MK0LX368Ib/view?usp=sharing

          Thanks,
          ZAPTEST Team

          • This reply was modified 3 months, 3 weeks ago by Sasha ZAP.
          • This reply was modified 3 months, 3 weeks ago by Sasha ZAP.
          • This reply was modified 3 months, 3 weeks ago by Sasha ZAP.
          Attachments:
          You must be logged in to view attached files.
          #75292
          Antonia Alleyne
          Participant

            Hello Sasha, My apologies for the delay. I didn’t realize that I needed to log in in order to see the messages.

            However, I tried the command that you mentioned above
            Application(“Expert Window”).View(“Dev Console”).Object(“Enter command”).Type(“sensor.probe-override-window-name “Long Axis”test “);
            and that did not work.

            I was able to get it to type by using the command
            Application(“Expert Window”).View(“Dev Console”).Object(“Enter command”).Type(“sensor.probe-override-window-name “Long Axis” “);
            but I need the quotes to be specific in order for me to use what it types.

            If I switch the quotes to the command below, then it does not work.
            Application(“Expert Window”).View(“Dev Console”).Object(“Enter command”).Type(“sensor.probe-override-window-name “Long Axis” ”);

            Does that mean that the outer quotes must always be “” and the inner “”

            Also attached screenshot below

            Attachments:
            You must be logged in to view attached files.
            #75294
            Antonia Alleyne
            Participant

              didn’t realize that the quotes would look the same once I submitted, but the image is reflective of the two different quote types.

              #75332
              Sasha ZAP
              Moderator

                Hello Antonia,
                Basically there are 2 ways to type a string inside quotes:
                1. If you are setting ZAPTEST scripting language to JavaScript then you should use this format of text:
                https://drive.google.com/file/d/1KBCfkTI4k0UvTmA3nfSZbj5TMsOw2cfU/view?usp=sharing

                2. If you are setting ZAPTEST scripting language to VBScript then you should use this format of text:
                https://drive.google.com/file/d/19V9XFpYqWf8MNF9LkqueNJ7jyD2XRUVj/view?usp=sharing

                P.S. In Test Settings you can set ZAPTEST’s Script Language:
                https://drive.google.com/file/d/1U1OoqHqUj_cJSuygf5WBpLKNZjDC3Ji9/view?usp=sharing

                Hope this helps,
                Thanks,
                ZAPTEST Team

              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.