18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

How to select font node?

mb2mb2 Members
edited November -1 in Sahi - Open Source
I am using Sahi to record my actions in IE8 on a Windows 7 machine. My page contains this markup:

<td id="ButtonText" class="myClass">
<font title="unique title" onclick="CallThis()">ButtonText</font>
</td>

When I click the button defined above, Sahi records:

_click(_cell("Button Text"));

But when I play this back, the button is not clicked. However,

_assertExists(_cell("Button Text"));

returns true.

I have added the following line into the concat.js file to try to make it detect font nodes:

this.addAD({tag: "FONT", type: "null", event:"click", name: "_font", attributes: ["sahiText", "title|alt", "id", "index", "href", "className"], action: "_click", value: "sahiText"});

but this doesn't seem to have had any effect (I have restarted Sahi). I don't have any control over the page being tested and I am not sure whether the td node or the font node is being selected.

How do I fire the onclick event of the font node?

I am using the most recent build of Sahi as of Sep 2012.

I have posted the same question on Stack Overflow, but believe this is probably a more appropriate place to ask.

Thanks,
MB

Comments

  • mb2mb2 Members
    edited September 2012
    Not getting this to work is a deal-breaker with regards to using Sahi and I am really keen to find a workaround. I have opened a bounty on Stack Overflow if anybody is able to help.

    I am unable to post a link, but the question is titled 'how-to-select-font-node-in-sahi' and has question id 12267130.

    Narayan - Thanks for the help you have already given. Sahi seems like such a great product and this is the only thing holding us back.

    Much appreciated,
    MB

    http://stackoverflow.com/questions/12267130/how-to-select-font-node-in-sahi
  • The solution to the problem was to remove the quotes around "null":

    this.addAD({tag: "FONT", type: null, event:"click", name: "_font", attributes: ["sahiText", "title|alt", "id", "index", "href", "className"], action: "_click", value: "sahiText"});

    Is this right?
  • The solution to the problem was to remove the quotes around "null":

    this.addAD({tag: "FONT", type: null, event:"click", name: "_font", attributes: ["sahiText", "title|alt", "id", "index", "href", "className"], action: "_click", value: "sahiText"});

    Is this right?


    Yes - my colleague pointed me in the right direction and this resolved the problem.
This discussion has been closed.