Thanks Joe for ur reply...but its throwing error :
*Used the below code in my step defs :*
link_href = @browser.a(:text=>'tags_rule').attribute_value("href")
link_href_arr = link_href.split("?")
@browser.a(:href=>"delete.page?#{href_arr[href_arr.count - 1]}")
*Error :*
undefined local variable or method `href_arr' for #<Object:0x2a5f940>
(NameError).
Thanks.
On Wednesday, June 26, 2013 12:10:44 PM UTC+1, watir webdriver wrote:
>
> Hi,
>
> In my application I've a table with 40 rows.How do I delete some specific
> <td> named as "default","tags","city","organic" in that table? All the
> deletes links are images with the same *
> src **name*.Plz find the attachment of the table row.
>
> My step def:
> Then(/^I click on all the delete rules on the setup page$/) do
> words = ["default", "tags","organic","city"]
> @current_page.delete_rules(:words => words)
> end
>
> In my ruby class I've added delete_rules method as below :
> def delete_rules(words)
> image_elements(:src => "/tracker/images/skin2/bin.png").click
> end
> Problem here is its deleting the first row in the table..not the rows
> which I've mentioned in the array.
>
> My HTML is :
> <tr>
> <td>
> <a href="edit.page?id=83">tags</a>
> </td>
> <td>
> <a href="delete.page?did=83">
> *<img title="Delete" src="/tracker/images/skin2/bin.png">*
> </a>
> <a href="edit.page?id=83">
> <a href="activate.page?id=83">
> </td>
> <td> </td>
> <tr>
> <td>
> <a href="edit.page?id=83">default</a>
> </td>
> <td>
> <a href="delete.page?did=83">
> *<img title="Delete" src="/tracker/images/skin2/bin.png">*
> </a>
> <a href="edit.page?id=83">
> <a href="activate.page?id=83">
> </td>
> <td> </td>
> <tr>
> <td>
> <a href="edit.page?id=83">organic</a>
> </td>
> <td>
> <a href="delete.page?did=83">
> *<img title="Delete" src="/tracker/images/skin2/bin.png">*
> </a>
> <a href="edit.page?id=83">
> <a href="activate.page?id=83">
> </td>
> <td> </td>
> <tr>
> <td>
> <a href="edit.page?id=83">city</a>
> </td>
> <td>
> <a href="delete.page?did=83">
> *<img title="Delete" src="/tracker/images/skin2/bin.png">*
> </a>
> <a href="edit.page?id=83">
> <a href="activate.page?id=83">
> </td>
> <td> </td>
>
> Your help is much more appreciated.
>
> Thanks in advance.
>
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.