我们在web应用程序中使用Selenium IDE测试工具。我在使用select命令时感到困惑;我需要使用select命令从下拉列表中选择一个值。
在select ( selectLocator,optionLocator )中,为了从下拉列表中选择一个选项,我们可以提供什么来代替selectLocator和optionLocator?
发布于 2011-12-22 20:54:12
在命令select (selectLocator,optionLocator)中,'selectLocator‘是从中选择值的下拉列表的Id,'optionLocator’是正在选择的值。
例如:假设下拉列表中的Id="//select[@id='type'"的值类似于'TypeA,TypeB,TypeC,...‘。如果你从下拉列表中选择'TypeA‘,你的命令应该是这样的:
selenium.select("//select[@id='type']", "label=TypeA");我希望这能解决你的问题。:)
https://stackoverflow.com/questions/6314330
复制相似问题