2011-03-28 36 views

回答

0

我不知道下測試您的應用程序的行爲允許數值,但情況,你提到inputfields不接受鍵入值,下面的代碼可以做你想做的事情。以下代碼是用Java編寫的,並使用Selenium 1 API和JUnit。

type("inputfieldlocator", "hello"); 
String fieldVal = getValue("inputfieldlocator"); 
assertEquals("", fieldVal); 

按照以下要求將代碼作爲selenium IDE html。

<tr> 
    <td>assertNotValue</td> 
    <td>inputfieldlocator</td> 
    <td>hello</td> 
</tr> 
<tr> 
    <td>type</td> 
    <td>inputfieldlocator</td> 
    <td>hello</td> 
</tr> 
+0

謝謝你的回答。你能否提供這個在Selenium IDE腳本中(在html中)。乾杯 – Check 2011-03-31 03:25:29

+0

我已在我的答案中添加了該代碼。 – marma 2011-04-01 09:52:49