Adding Strings Within a String
Home › Forums › Ask Expert › Suggestion Box › Adding Strings Within a String
Tagged: using double quotes
- This topic has 5 replies, 2 voices, and was last updated 3 months, 1 week ago by Sasha ZAP.
-
AuthorPosts
-
January 5, 2024 at 8:18 pm #74686Antonia AlleyneParticipant
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.
January 5, 2024 at 9:11 pm #74688Sasha ZAPModeratorHello 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.
January 5, 2024 at 9:17 pm #74691Sasha ZAPModeratorHello
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=sharingThanks,
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.January 15, 2024 at 8:34 pm #75292Antonia AlleyneParticipantHello 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.January 15, 2024 at 9:17 pm #75294Antonia AlleyneParticipantdidn’t realize that the quotes would look the same once I submitted, but the image is reflective of the two different quote types.
January 17, 2024 at 12:44 am #75332Sasha ZAPModeratorHello 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=sharing2. 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=sharingP.S. In Test Settings you can set ZAPTEST’s Script Language:
https://drive.google.com/file/d/1U1OoqHqUj_cJSuygf5WBpLKNZjDC3Ji9/view?usp=sharingHope this helps,
Thanks,
ZAPTEST Team -
AuthorPosts
- You must be logged in to reply to this topic.