A Dynamic String

Applying eValid to AJAX applications that require advanced DOM-based methods.

A Dynamic String

Postby balance » Fri Aug 05, 2011 3:12 pm

There is a dynamic string that is generated each time our app processes an order. It looks something like this:

Order Confirmation # 230000 - 412940

Is there a way to only grab the "230000" portion of this string and store it as a variable to be used later? I know how to use the ValueGetElement/ValueSave commands but that only grabs the whole string. I need a way to only grab the six characters of "230000" in order to automate my tests.

Thanks!
balance
 
Posts: 2
Joined: Fri Aug 05, 2011 3:04 pm

Re: A Dynamic String

Postby eValid » Fri Aug 05, 2011 3:19 pm

In general what you are looking for is called "substring".

You want the 6-character substring at the beginning of the string that is extracted from the DOM.

To do this you probably need to use the "StrCmpNC" verb in the Windows batch command system (called the shell, not to be confused with the powershell).

Search for "Shell String Handling Functions (Windows)" and you will find the manual for it.

This function work in a *.bat file, which can be invoked with a SystemCall command after you write the values into a local file with ValueSave command.

________________
eValid Support
eValid
 
Posts: 2396
Joined: Tue Jan 01, 2008 12:48 pm
Location: USA


Return to AJAX Applications & DOM Processing

Design Downloaded from free phpBB templates | free website templates | Free Web Buttons