Ask a Question

Using the KeywordTest, is there a way to set the first x number of characters from last operation?

SOLVED
jg0888
Contributor

Using the KeywordTest, is there a way to set the first x number of characters from last operation?

I want to search from specific value that displays on the UI. It displays as "Lastname, Firstname", and I want to select the "Lastname" before the comma. If there isn't a way to do this, can I select the first 4 characters to then set the text into a search bar.

 

These values change depending on different values on the UI. Is there a way to do this?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
shankar_r
Community Hero

Re: Using the KeywordTest, is there a way to set the first x number of characters from last operatio

In common, you can always aqString.SubString as this is TestComplete in-build function.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

View solution in original post

3 REPLIES 3
baxatob
Community Hero

Re: Using the KeywordTest, is there a way to set the first x number of characters from last operatio

You can get a full string and then get a slice (first 4 characters) from it.

 

fullString = 'John, Doe'

In JScript, JаvаScript: 

subString = fullString.slice(0,4)


In Python:

subString = fullString[0:4]

Output: subString == "John"

etc...

 

shankar_r
Community Hero

Re: Using the KeywordTest, is there a way to set the first x number of characters from last operatio

In common, you can always aqString.SubString as this is TestComplete in-build function.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

View solution in original post

jg0888
Contributor

Re: Using the KeywordTest, is there a way to set the first x number of characters from last operatio

Awesome! I knew there had to be a good way to do this. As a non-developer using TestComplete, it is so cool to see that SmartBear has already configured these things into the KeywordTest Operations and Object Methods.

 

I called the Object Method of aqString and Operation SubString to accomplish the task I needed within my KeywordTest.

 

Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: