我选择了两个选项,里面有标记"空格" (请看Jsfiddle)。我无法在Selenium IDE中选择使用我的测试中选择选项。我该怎么做?
http://jsfiddle.net/fgh9szk3/1/
<select id="select">
<option value="1">USD </option>
<option value="3">EUR </option>
</select>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://jsfiddle.net/fgh9szk3/1/" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>
</thead><tbody>
<tr>
<td>select</td>
<td>css=#select</td>
<td>USD</td>
</tr>
</tbody></table>
</body>
</html>
答案 0 :(得分:0)
选择它by label
(意为可见文字),提供正则表达式:
<tr>
<td>select</td>
<td>css=#select</td>
<td>label=regexp:^USD</td>
</tr>
其中^
匹配字符串的开头。