tags:

views:

40

answers:

2

I'm trying to find the location of some text on a web page using Selenium. I can use the isTextPresent function to tell me if the text occurs, but then I want to know where it actually is.

The wider problem is that I want to click on this text. The problem is that I don't seem to be able to click on this text, which I think is in some control embedded on the page. So, it doesn't seem to be detected as a link or button or option etc. However, I need to click on it to make a selection.

Any thoughts ?

Thanks :)

A: 

Got it ! I don't know the answer to how to find the location, but, the more important bit is to click on that text.

I can just use an XPath locator in the click method, like :-

Click(xpath=//*[text()="hello"])

This will click on the element that has a text value of "hello". In my case, this is unique, so that's specific enough.

Glurk
close the question then
Pierre Gardin
A: 

If you use firefox, then you can to install some plagins - "Firebug", "fire xpath" - it is plugin for firebug :) and "xpath checker". They definitely help you to work with xpath.

Sometimes I cant click on "text" or "button", but these sites are using Ajax.

Can you show the sait which working now?

alexey.chumagin