issue with assertTable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

issue with assertTable

GW-5
Hi,
I have an editable table - ie a table that has td cells which have input boxes. I want to assert the value of certain cell in the table so I add the command

assertTable | mytable.1.2 | <input type="text" name="cell_1_2" value="Hello" />

I use Selenium IDE to generate this command. The problem is that the test runner fails with this command and actually renders the input box in the test runner instead of asserting on the textual value <input type="text" name="cell_1_2" value="Hello" /> for the given table cell. The test runner assert fails saying that the value for the cell was "".

Any ideas of how I can assert the value of an input box that belongs to a particular table cell?

Thanks,
Sanjiv
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1006&messageID=2802#2802

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with assertTable

Mike Williams-7
Sanjiv Jivan wrote:

>Hi,
>I have an editable table - ie a table that has td cells which have input boxes. I want to assert the value of certain cell in the table so I add the command
>
>assertTable | mytable.1.2 | <input type="text" name="cell_1_2" value="Hello" />
>
>I use Selenium IDE to generate this command. The problem is that the test runner fails with this command and actually renders the input box in the test runner instead of asserting on the textual value <input type="text" name="cell_1_2" value="Hello" /> for the given table cell. The test runner assert fails saying that the value for the cell was "".
>
>Any ideas of how I can assert the value of an input box that belongs to a particular table cell?
>  
>
Hmm, tricky.  How about

| assertElementPresent |
//table[@id='mytable']//tr[1]/td[2]/input[@name='cell_1_2'] | |

It won't tell you what the input-name was if it fails, though.

Actually, I'd probably write a custom assert command for something like
this.  Take a look in the sample user-extensions.js ... Selenium is
actually pretty easy to extend.

--
cheers, MikeW                            http://www.dogbiscuit.org/mdub/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...