How do you find out whether the string is Numeric or Alpha
numenric.Suppose..'QTP is an automation testing tool 12345'
How should I know it is alphanumeric.Can any one please
write the code for this

Answers were Sorted based on User's Feedback



How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an autom..

Answer / ashish sharma

str = "QTP is an automation testing tool "
Dim ianRegEx
Set ianRegEx = New RegExp
ianRegEx.Pattern = "[a-z]+[\s]*[0-9]+"
ianRegEx.Global = True
ianRegEx.IgnoreCase = True
msgbox ianRegEx.Test(str)

Is This Answer Correct ?    4 Yes 0 No

How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an autom..

Answer / a.thirumalareddy@gmail.com

use this function it will help u..

Function IsAlphaNumeric()
If IsNull(str) Then str = "QTP is an automation testing tool 12345"
Dim ianRegEx
Set ianRegEx = New RegExp
ianRegEx.Pattern = "[^a-z0-9]"
ianRegEx.Global = True
ianRegEx.IgnoreCase = True
IsAlphaNumeric = (str = ianRegEx.Replace(str,"QTP is an automation testing tool 12345"))

msgbox IsAlphaNumeric

End Function

call IsAlphaNumeric()

Is This Answer Correct ?    4 Yes 2 No

How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an autom..

Answer / xyz

Hi Tirumalareddy thanks for giving the reply.I have
executed the script.It is working fine for the above
srting.but if I removed 12345 from the string,still it is
displaying TRUE.I think it is not correct.anyhow thanks for
reply

Is This Answer Correct ?    2 Yes 0 No

How do you find out whether the string is Numeric or Alpha numenric.Suppose..'QTP is an autom..

Answer / mrclock

A.thirumalareddy was on the right track, but here is a
revised and working version of his code:

Function IsAlphaNumeric()
Dim strText: strText = "QTP is an automation testing tool
12345" 'Search String
Dim ianRegEx
Set ianRegEx = New RegExp
ianRegEx.Pattern = "[^a-z0-9]" 'Define Search Pattern
ianRegEx.Global = True 'Apply Globally
ianRegEx.IgnoreCase = True 'Ignore upper/lower case
IsAlphaNumeric = ianRegEx.Test(strText) 'Use Test method
for a True/False test
msgbox IsAlphaNumeric 'Display True/False
End Function

call IsAlphaNumeric()

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More QTP Interview Questions

What is the process for creating an automated test script using QTP assuming you have reviewed the manual test case and understand the requirements?

1 Answers   Infosys,


Diff. between keyword driven Data driven testing?

8 Answers   CTS, IBM,


How qtp identifies objects?

0 Answers  


i have an external excel datasheet where it only contains 3 rows. after qtp executed the code to import the datasheet, the datatable getrowcount method now gives me a different value, lets say 60,000+ instead of only 3. i did not have any values starting from row 4 of my excel file. why is this happening? this also results to the qtp report to load for a very long time.

0 Answers  


what is profile tool?

0 Answers   ITC Infotech, TCS,






write code to read and write data from file?

1 Answers   IBM,


What is your role and responsibilities in QTP with your current organization?

1 Answers   Oracle,


how can i count the number of links???

2 Answers  


hw to create a frame work in qtp..what are the basic steps

2 Answers   Infosys,


What are the Features & Benefits of Quick Test Pro ?

0 Answers   Crea,


How will you declare a variable in qtp?

0 Answers  


please post the interview questions for QA position in FACTSET

0 Answers   FactSet Systems,


Categories