/html/body/div[4]/table/tbody/tr[2]/td/div/table/tbody/tr[2]/td/div/div
[5]/div/table/tbody/tr[2]/td/div/div/div/div/div/table/tbody/tr/td/
table/tbody/tr/td/div/div/div[2]/table/tbody/tr[4]/td[3]
When I call selenium.click("/html/body/div[4]/table/tbody/tr[2]/td/div/
table/tbody/tr[2]/td/div/div[5]/div/table/tbody/tr[2]/td/div/div/div/
div/div/table/tbody/tr/td/table/tbody/tr/td/div/div/div[2]/table/tbody/
tr[4]/td[3]"), I get an object not found error.
Can anyone help me figure out how I can successfully click on this
table cell?
Thanks,
Davina
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
Open that webpage and open selenium IDE.
In Target u enter that entire XPATH and click the Find button and
check whether the link or field u want is highlighted or not..
If it is highlighted the XPATH is correct if not it is not correct....
Do u have ant text in td[3]...If u provide so it would be help to find
out another means ...
Thanks,
Meerasaaheb Mohmmad
As Santiago has pointed out, if you copied it from Firebug it is most
likely the correct xpath. What happened before you do the click is
probably the problem. For example, if the code is:
// login
// click the cell in the table
You might want to change it to:
// login
// wait for page to load
// click the cell in the table
Anytime a new page loads you should always wait for the page to finish
loading. Additionally, if you are using javascript and an action on
the current page updates the DOM (onchange or onclick events), you
need some code to wait for the change to occur. For example, I have a
select list of companies. When you select a company, AJAX code updates
a second select list with the employees of that company. It can take a
few seconds if the company has a lot of employees. I needed the
developer to add in something to flag when the change was finished. I
then wrote my own waitForEmployeesToLoad() method based on that flag.
Darrell
"xpath=//TD[contains(text(),'foo')]"
rather than something like:
"text=foo"
Additionally, if the cell is actually defined as:
<td><span class="something">foo</span></td>
then the text is really part of the SPAN and not part of the cell. I'd
use:
"xpath=//SPAN[contains(text(),'foo')]/.."
to find the cell.
> > selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go oglegroups.com>
This will try to reduce the length of the XPath reference and seems to
be quite good at getting unique paths referenced to an id.
You will have to check the syntax, for example, I just captured an
XPath using XPath Checker and it gave me:
id('content')/table/tbody/tr[3]/td/table/tbody/tr[2]/td/img
Selenium needs:
//img[@id='content']/table/tbody/tr[3]/td/table/tbody/tr[2]/td/img
or the //img may need to be //td or //tr or //table, it depends on the
html. The good thing about XPath Checker is that it will interpret
the selenium format XPaths so you can put the edited version back in
and check it finds it.
I have seen situations in the past where the html in IE is subtly
different to the html in firefox so having an id referenced XPath will
reduce the chance of this being a problem compared to the full html
path from the root of the page.
Alternatively, if you look at the <td> element at the end of the chain
with firebug and it has some content that can identify it uniquely you
could try that. For instance if it has a href="texttextsomething
uniquetexttext" attribute you could try:
//td[contains(@href,'something unique')]
HTH
David Lambert
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.