Hi,

I think you could do this

link_href = @browser.a(:text=>'tags_rule').attribute_value("href")
link_href_arr = link_href.split("?")
@browser.a(:href=>"delete.page?#{hr_arr[hr_arr.count - 1]}")

This should work.




On Wed, Jun 26, 2013 at 7:10 AM, watir webdriver <
[email protected]> 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.
>
>
>

-- 
-- 
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.


Reply via email to