i have an array CAPGEMINI .....Here i need to check whether
G is there or not ..how to do that
and friends i have one big doubt that is
whether it is array or string ,how we come to know that and
where we consider that it's array ,where we consider that
it's an string
because when i want to find the length i have big doubt
whether we need to use len function or ubound ...
ans me for this TWO Questions any one please
Answers were Sorted based on User's Feedback
Answer / udayakiran
This might be the solution If we consider it as array:
ar2 = Array("C","A","P","G","E","M","I","N","I")
arlen=UBound(ar2)-lbound(ar2)+1 'Finding array length
For p= 0 to arlen-1
If strcomp(ar2(p),"G")=0 Then
msgbox "The letter G is found"
Exit For
End If
Next
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / tarakeshwar
a="CAPGEMINI"
length = len(a)
flag ="G is not present"
For i = 1 to length
res= mid(a,i,1)
if res = "G" then
flag = "G is present"
End if
Next
msgbox flag
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / arun
Please try this
Dim AR2,i
AR2 = Array("C","A","P","G","E","M","I","N","I")
For i=0 to ubound(AR2)
If AR2(i)="G" Then
msgbox "G found in Array"
End If
Next
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / gabbar
Dim a
a=array("CAPGEMINI" )
If len(join(a))<>len(Replace(join(a),"G","")) Then
msgbox "Occurance of G in array: "&len(join(a))-len(Replace(join(a),"G",""))
End If
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / koteswar
str = "CAPGEMINI"
z= "G "
flag = 0
For i = 1 to len(str)
x = mid(str, i, 1)
If Instr(1,z,x,1) Then
msgbox z
If flag = 0 Then
Reporter.ReportEvent micPass, "The required Letter is
available in the stirng", "True"
else
Reporter.ReportEvent micFail , " The required Letter is
not availabe in the string" , "False"
End If
End IF
Next
Array means It is a collection of similar objects and
enclosed with curly braces. at that time you can use Ubound
for count the no of objects are available in the given array
Srring means single or collection alphanumeric characters
enclosed with quotations. If you want to count the no of
characters in the given string you can use len()
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / rajesh
see that is my question...here you also confused, here
CAPGEMINI is a array ,not a string..give a ans please
Is This Answer Correct ? | 1 Yes | 0 No |
how to create external data table?
Tell about descriptive programing in qtp8.2?
What is the difference between Dim And Redim
4 Answers Hotel Jobs, IBM, Microsoft,
Hi All Below is my script which i made for lgin into Flight.exe. SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open" Dialog("Login").WinEdit("Agent Name:").Set DataTable ("p_Text", dtGlobalSheet) Dialog("Login").WinEdit("Agent Name:").Type micTab Dialog("Login").WinEdit("Password:").SetSecure DataTable ("p_Text1", dtGlobalSheet) Dialog("Login").WinButton("OK").Click If Dialog("Login").Dialog("Flight Reservations").WinButton ("OK").exist Then Dialog("Login").Dialog("Flight Reservations").WinButton ("OK").Click datatable.Value(3)= "Incorrect password. Please try again" Dialog("Login").WinButton("CANCEL").Click elseif Dialog("Login").Dialog("Flight Reservations").WinButton("OK").exist Then Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click datatable.Value(3)="Please enter agent name" Dialog ("Login").WinButton("CANCEL").Click elseif Dialog("Login").Dialog("Flight Reservations").WinButton("OK").exist then Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click datatable.Value(3)= "Please enter password" Dialog("Login").WinButton ("CANCEL").Click else Window("Flight Reservation").Move 309,146 datatable.ExportSheet "C:\Raj\Result.xls" ,1 Window("Flight Reservation").Close End If I want to capture the Message string from Dialog("Login").Dialog("Flight Reservations" Also pls let me know if this is the right way to do the script for login. Pls provide some script for login Flight.exe Thanks in advance Raj Dhiman
What type of VB script u had done in expert view?
Describe the differences between functions and actions in UFT?
how to choose the framework in qtp ? 2)when we go for the descriptive programming ?
How does Parameterization and Data-Driving relate to each other in QTP?
How to execute a WinRunner Script in QTP?
Diff b/w Test Design and Test case design? What is the Design Review's and Code Review's. When will you conduct tese reviews?
Anybody plz give, How do you test aframe in a web page? If page cotain text message or Images, tables?
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