Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6380111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:13:30+00:00 2026-05-25T02:13:30+00:00

I am attempting to create a VBScript function (within the context of QuickTest Pro

  • 0

I am attempting to create a VBScript function (within the context of QuickTest Pro 10) that is able to take in a line of code as a parameter, such as: JavaWindow("Export Control Notice").JavaButton("OK").Click

Problem is, when I try passing that line as a string, VBScript understandably chokes on the quotes. Here is the catch: I have many lines of code similar to the one above, so I would like to take the line of code and pass it as is. I don’t want to go around doubling the quotes for these lines of code, let along for every new line that QTP records. (Find/Replace All can easily go out of control)

How can I pass the above line of code?
If turning it into a string is the way to go, how can I encode that line so VBscript doesn’t choke on the quote marks?

Additionally, I haven’t been able to find any way to change the delimiter to something other than quote marks to assign the line of code as a string. Finding a way to change the delimiter would probably solve this issue.

Alternately, I’ve also tried passing JavaWindow("Export Control Notice").JavaButton("OK") as an object into the function and that has worked. Unfortunately, there doesn’t seem to be a way to turn that object back into a string in order to append ".Click" (or some other action stored as a string) back onto the end of it. Am I overlooking something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:13:31+00:00Added an answer on May 25, 2026 at 2:13 am

    Depending on how exactly you ‘have’ those lines of code (in your head, in a text document, …) and whether you prefer to type or to program you can

    • put them into VBScript code using the proper escape (“”):

      Dim sCodeLine : sCodeLine = "JavaWindow(""Export Control Notice"").JavaButton(""OK"").Click"
      WScript.Echo sCodeLine
      
      JavaWindow("Export Control Notice").JavaButton("OK").Click
      
    • put them into VBScript code using a delimiter of your choice and Replace():

      Dim sCodeLine : sCodeLine = "JavaWindow('Export Control Notice').JavaButton('OK').Click"
      WScript.Echo Replace( sCodeLine, "'", """" )
      
      JavaWindow("Export Control Notice").JavaButton("OK").Click
      
    • put them in an external file (.txt, .xls, .xml, …) (resp. use the given document); load and parse the file into a suitable data structure (array, dictionary, …). Use that collection to feed your function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to execute a .NET (3.5) command line program from within a VBScript
I am attempting to create a generic mapping function that takes the values of
I'm attempting to create a custom calendar control that inherits from ASP.Net's built in
I'm attempting to create a NotifyIcon that can be inherited so that I can
I'm attempting to create a function with flags as its arguments but the output
I am attempting to create a php script that can connect thru ssh to
I'm attempting to create an xquery expression that will return selected nodes but will
I am attempting to create a login system that has two access levels. If
I'm currently attempting to create a tabbed interface in a web application, and based
I am attempting to create a small application to collect data received from an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.