Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String comparision using Data sheet:- inconsistant behaviour.
#1
Not Solved Toungue 
hello all,
i have found some wired behaviour in qtp 9.2
i want to compare the images which are displayed in listbox.
i have applied following code.
The comparision working fine but sometime the imagename and the name entered in datasheet both are exactly same evenif i have printed them using message box but it cann't work.

I have no any idea how its possible.

Please look at my code and let me know i am going to right way or not ?
let me know if anyother logic can work here
The code is as follows:


Code:
public Function imageSelection()
Dim i
i = Browser("Certificate Error: Navigation").Page("Ion Ad Manager on QAS1_8").WebList("assocImg").GetROProperty("items count")

image1 = trim(DataTable("Img1", dtGlobalSheet))
image2 = trim(DataTable("Img2", dtGlobalSheet))
image3 = trim (DataTable("Img3", dtGlobalSheet))
image4 = trim(DataTable("Img4", dtGlobalSheet))
image5 = trim(DataTable("Img5", dtGlobalSheet))

For counter = 1 to i
j = trim(browser("Certificate Error: Navigation").Page("Ion Ad Manager on QAS1_8").WebList("assocImg").GetItem(counter))
    If strcomp( image1,j,1)=0 Then
    msgbox "Image-1 Pass"
    wait(5)
    Browser("Certificate Error: Navigation").Page("Ion Ad Manager on QAS1_8").WebList("assocImg").ExtendSelect(image1)
        msgbox "First Image is selected successfully" & image1
    end if

    If strcomp(image2,j,1)=0 Then
    Browser("Certificate Error: Navigation").Page("Ion Ad Manager on QAS1_8").WebList("assocImg").ExtendSelect(image2)
     msgbox "Second  Image is selected successfully" & image2
          End If

    If strcomp(image3,j,1)=0 Then
    'Browser("Certificate Error: Navigation").Page("Ion Ad Manager on QAS1_8").WebList("assocImg").ExtendSelect(image3)
    End If

    If strcomp(image4,j,1)=0  Then
Browser("Certificate Error: Navigation").Page("Ion Ad Manager on QAS1_8").WebList("assocImg").ExtendSelect(image4)
    'End If
        
   If strcomp(j,image5,1)=0  Then
Browser("Certificate Error: Navigation").Page("Ion Ad Manager on QAS1_8").WebList("assocImg").ExtendSelect(image5)
        wait(5)
End If
next
End Function

Waiting for Reply
Chetan
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP Excel Comparision gautamwin 2 2,220 08-26-2013, 03:42 AM
Last Post: Novemberrain81
  data sheet row count rushil 2 7,693 12-07-2012, 03:10 AM
Last Post: rushil
  How to have a variable that has a string comma string .. shareq1310 5 5,098 11-09-2011, 03:33 PM
Last Post: parminderdhiman84
  How to save Runtime data value in an Excel sheet(specific column) SweetyChowdhury 2 7,804 11-12-2010, 01:05 AM
Last Post: Anu123
  How to use Data Sheet in BPT component Rajashekar Gouda Hotur 2 6,292 05-20-2010, 11:06 AM
Last Post: Rajashekar Gouda Hotur

Forum Jump:


Users browsing this thread: 1 Guest(s)