Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Choosing element from array
#1
Solved: 8 Years, 6 Months, 2 Weeks ago
Hi friends!
I have array which take elements from combobox in page (which has webelements, one of them i want to choose and click)

Dunno even if its good:
Code:
Public Function FnGetWebEdits()
       Set oDesc = FnGetDescription(Array(_
                       Array("micclass","WebElement"),_
                       Array("class", "x-combo-list-item"),_
                       Array("visible", true)))
       Set objList = Browser("Update Record").Page("Update Record").ChildObjects(oDesc)  
       print objList.Count
       For i = 0 To objList.Count-1 Step 1
            print objList.GetRoProperty("name")
       Next
       Set FnGetWebEdits = objList
   End Function

When i check elements number by:


Code:
Set objInList = FnGetWebEdits()


It shows properly number of them which is 38.

Now is my question. How can i choose one element from it which im interested in and click it?  Rolleyes
I suspect i must use "for" but don't know how :/
Reply
#2
Solved: 8 Years, 6 Months, 2 Weeks ago
Do you know the object name that you wish to work on? or is there any unique value for the web element that is available?


IF yes, you can use a for loop to iterate through each item in objInList.


Code:
For Each oEdit in objInList
 strValue = oEdit.GetRoProperty("<YouUniqueKnowProperty>")
 If Ucase(strValue)="<ExpectedValue>" THEN
    <You Further Steps>
End IF
Next
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Page element keep changing chong67 4 4,621 11-08-2016, 09:17 PM
Last Post: Paul Rammone
  Web Element: Not able to select value from drop down in Web Element. Rajeev 4 5,296 08-04-2015, 06:03 PM
Last Post: kbhargava505
  How to capture tool tip within a web element frebuffi 3 3,751 11-10-2014, 10:06 AM
Last Post: learning_UFT
  How to connect two web element objects? zawarepradeep@gmail.com 1 2,649 07-23-2014, 11:23 PM
Last Post: Ankur
  How to convert a single dimension array to two dimensional array venkatesh9032 3 5,528 02-10-2014, 03:07 PM
Last Post: pranikgarg

Forum Jump:


Users browsing this thread: 1 Guest(s)