Get numbers inside all webelements in webtable and sort them
You have a web table having 3 rows and 3 columns. Inside web table all are web elements and 9 numbers(3,1,9,4,7,2,6,5,8) were there inside these web elements. Retrieve all these 9 numbers and sort them.
I have written this below code please check once and let me know anything wrong and if any better solutions for this.
set wb=browser().page().webtable()
rc=wb.rowcounnt
For i = 1 To rc
cc=wb.columncount(i)
For j = 1 To cc
txt=wb.childitem(i,j,"Webelement",0).getroproperty("innertext")
a=a&txt&";"
Next
Next
b=split(a,";")
For i=0 To ubound(b)
For j=0 To ubound(b)
If strcomp(b(i),b(j),1) < 0 Then
temp = b(i)
b(i)=b(j)
b(j)=temp
End If
Next
Next
For i=0 To ubound(b)
msgbox b(i)
Next
-
Interview Candidate
- Aug 2nd, 2016
- 1
- 5606
Showing Answers 1 - 1 of 1 Answers
Related Answered Questions
Related Open Questions
Get numbers inside all webelements in webtable and sort them
I have written this below code please check once and let me know anything wrong and if any better solutions for this.
set wb=browser().page().webtable()
rc=wb.rowcounnt
For i = 1 To rc
cc=wb.columncount(i)
For j = 1 To cc
txt=wb.childitem(i,j,"Webelement",0).getroproperty("innertext")
a=a&txt&";"
Next
Next
b=split(a,";")
For i=0 To ubound(b)
For j=0 To ubound(b)
If strcomp(b(i),b(j),1) < 0 Then
temp = b(i)
b(i)=b(j)
b(j)=temp
End If
Next
Next
For i=0 To ubound(b)
msgbox b(i)
Next
Related Answered Questions
Related Open Questions