zli034 has asked for the wisdom of the Perl Monks concerning the following question:

I have problem to use locater of www::selenium to follow a link of a webpage. This link has a id as its locater and with a href attribute, not a exactly html link. I can't find any instruction or codes to explains this.

<a id="ctl00_MainCol_DataList1_ctl00_SearchListing1_FrmImage_hlMoreInfo" href="javascript:__doPostBack('ctl00$MainCol$DataList1$ctl00$SearchListing1$FrmImage$hlMoreInfo','')">More Info</a><br />

When I use click($locator), of cause it gives me error messages.

The selenium RC and perl function really good on my PC. I just need selenium to surf some link and get_text(). This can save me lots of work. Very appreciated if anyone can help me out.

Zli034

Replies are listed 'Best First'.
Re: Need help with selenium locator
by Gangabass (Vicar) on Sep 06, 2007 at 05:50 UTC

    Did you try

    $sel->click("ctl00_MainCol_DataList1_ctl00_SearchListing1_FrmImage_hlM +oreInfo");

    What error message it gives to you?

      NO this doesn't work.

      IE shows a error window:

      Internet explorer javascript error... and access denied

      I don't know why I can access the javascript on the webpage by using selenium?

        Can you enable debugging of Javascript errors in IE and try again? Please provide complete error text.

      assign ("ctl00_MainCol_DataList1_ctl00_SearchListing1_FrmImage_hlM +oreInfo") to a varible. see what the results is