Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compare Webelement with Datatable Values
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi All,

I need to compare the value of WebElement which i feteched at run time using GetRoProperty("innertext"). Now i need to compare this value with all the values that i had in my datatable one by one and if i found the value then i have to see at which row the value exists. Please let me know how to do this.

Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi

Using the below code you can fetch the webelemt innertext runtime at the same time you can compare that value in ur datatable which is avaiable in ur Global sheet

Code:
strSrch = Browser().Page().Frame().webelement("innertext")
strFound = False
RCnt =Datatable.GetRowCount
CCnt =  Datatable.GetSheet("Global").GetParameterCount
For iR = 1 to RCnt
  For iC =1 to CCnt
    Datatable.SetCurrentRow(iR)
    strval= Datatable.Value(iC)
    If strcomp(strSrch,strval,1)=0 Then
      Msgbox "Search String Found in## " &iR & "##Row"
      strFound = True
      Exit For             
    End If
Next
If strFound = True Then
   Exit For
End If
Next
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation WebElement("WebElement").Click is not working sia sharma 7 23,181 09-28-2016, 08:58 PM
Last Post: supputuri
  [UFT] Compare value of List with DataTable robertosalemi 2 2,878 04-06-2016, 08:12 PM
Last Post: robertosalemi
  Compare WebTable Elements saraiado 1 2,445 06-11-2015, 06:54 PM
Last Post: venkatesh9032
  Writing values to DataTable chewbecca 2 2,960 04-09-2015, 05:48 PM
Last Post: chinnikrishna
  Webelement Values profqa 1 2,273 01-05-2015, 11:07 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)