09-14-2017, 04:19 PM
(05-18-2012, 06:29 PM)mesg2anil Wrote: Hi,
I'm having difficulty scripting for below situation...
I have a dropdown list, in the dropdown list I've values as below...
one
two
three
four
five
I want to find the dropdown object exists or not based on the dropdown list values as shown above. How to find the object? Please help!!
Regards,
Anil
Hi you can use the Excel,You can matching the value with application drop down value to Excel input value:
Function DropDownValidation(Str_ExcelPath)
Str_ExcelPath= "C:\Users\chvijay\Desktop\SDB_Dropdwon list_5.0.xlsx"
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.WorkBooks.Open(Str_ExcelPath)
Set objDriverSheet = objWorkbook.Worksheets("witholding-tax-code")
count_rows=objDriverSheet.usedrange.rows.count
DropDownItems=Browser("INTEGRATION").Page(INTEGRATION").WebList("frm:tabView:integratedLocalAcc_5").GetROProperty("all items")
Str_Result=split(DropDownItems,";")
For i = 0 To UBound(Str_Result) Step 1
finelresult=Str_Result(i)
finelresult1=finelresult1&" "&finelresult
Next
print "Item In Drob Down"&"-"&finelresult1
For j= 2 To count_rows Step 1
read_Value_Excel= objDriverSheet.cells(j,1).value
print "ReadValue From Excel"&" "&read_Value_Excel
If ucase(trim(instr(finelresult1,read_Value_Excel)>0))Then
objDriverSheet.cells(j,5)="Available"
DropDownValidation=true
else
objDriverSheet.cells(j,5)="Not Available"
'MsgBox "Not Write"
DropDownValidation=False
End If
Next
objWorkbook.Save
wait 2
objExcel.Quit