The string is like POWER STAR PAVAN , write a script for
this how to findout the number of "A" in the string ?
Answer Posted / madhulika
function VerifyLetters(S_String,S_Pattern,MatchStr)
Set OReg = new RegExp
Set S_Pattern = OReg.Pattern
OReg.IgnoreCase = True
OReg.Global = MatchStr
Set Matches = OReg.Test(S_String)
MatchFound = Matches.count
VerifyLetters = MatchFound
End Function
-------------------------------------
val = "Power star pavan"
'Calling function
msgbox VerifyLetters(val,"A",True)
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How does QTP identify an object?
What is the significance of “action 0” in qtp?
i can done the project with QTP in that time i can say how many members in my team size?
Functions call by reference and call by value. i want the diff b/n these 2 and how will be the script for this?in which situation we use these 2..?pls explain me clearly
QTP script is not working on other's machine..
Hi Friends, I worked with 8.2 not with 9.2. Please help me in this prob. I created one script and recorded some think and save as Test 1 then I opened process--open the object repository manager. Switch to file->save->give some name->save as Objectrepo1.tsr file. (This is the global repository file.) Then I went to object repository->tools-> associate repository ->click + icon ->open the previously saved Objectrepo1.tsr file. This is the global repository Now I created one more script and save as Test 2. In this script I am calling script with the Help of "Call of existing action" and I executed but QTP is not able to execute B’cos it is QTP is not able to read the Object Repository of Test 1. Please let me know why? Once I made Script 1 as a shared Obj. Repository so it would not give any Problem. Right?
Hello friends..... On which areas of an application we can not test with QTP
Where should i find checkpoint and virtual objects's Object properties and values in the QTP 9.2 Means where checkpoints or virtual objects related data will store If i want to get the runtime object properties how can i use Getroproperties on Checkpoints
i am a begnner so am learning Error handling :tried using Recovery manager didnt work i want to be able to handle errors , e.g. if while running the test the folwoing does not show up then how can i use the If then else and goto next step in the test, as in many scenarios it does not show up Browser("The Shopping Channel -").Page("The Shopping Channel -_8").Image("easy pay").Click
In Test Directory, What are the contents in test case designing? if you prepare in excel sheet how u use thrw Test Directory?
Get the count of files of similar types from a folder.
Can an action have 2 shared object repositories associated with them? In that case, if two of them contain the same object, which one will be considered?
What are the various types of Actions in UFT?
How to build scripts that access data from external sources?
I have created 3 actions in test action1, action2, action3 but I want run action 1,action 3,action2 how can you change in the actions in keyword view?