从下拉列表中选择值

从下拉列表中选择值

本文介绍了AutoIT-如何从下拉列表中选择值(组合框)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AutoIT自动化Windows应用程序.为此,我尝试从下拉列表中选择值,但无法选择该值.下面是我的代码.

I am automating Windows application using AutoIT.As part of this i tried to choose value from drop down, but I'm unable to select the value. Below is my code.

ControlCommand("Database Select","", "[Name:db_comboBox]", "ShowDropDown")ControlCommand("DatabaseSelect","","Name:db_comboBox]","SelectString",'Test')ControlCommand("Database Select","Main Load Settings", "[Name:db_comboBox]", "HideDropDown")

ControlCommand("Database Select","", "[Name:db_comboBox]", "ShowDropDown")ControlCommand("DatabaseSelect","","Name:db_comboBox]","SelectString",'Test')ControlCommand("Database Select","Main Load Settings", "[Name:db_comboBox]", "HideDropDown")

任何人都可以帮助我如何从下拉菜单中选择价值.

Can anyone help me how to choose value from dropdown.

推荐答案

Milos,感谢您的帮助,以下代码解决了我的情况.

Milos, Thanks for your help and the below code solved my case.

  ControlClick("Database Select", "", "[Name:db_comboBox]")
  While 1
    Send("{DOWN}")
    $ctext=ControlGetText("Database Select","","[Name:db_comboBox]")
    If $ctext="DB_UKTEST" Then
        ExitLoop
    EndIf
  WEnd

这篇关于AutoIT-如何从下拉列表中选择值(组合框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 14:10