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.

Click on emphasis

jessyjessy Members
edited November -1 in Sahi - Open Source
Hello,
I am trying to click on an emphasis, but it does not work
the code:

<td class="x-btn-mc">
<em unselectable="on" class="x-btn-split" id="ext-gen336">
<button type="button" id="ext-gen162" class=" x-btn-text test-icon xty_btn-FindPrat">Attribute</button>
</em>
</td>

I tried with _click(_emphasis("Attribute")), but no efect
The Sahi records it like that, but then cannot be played....

Comments

  • chetan5pchetan5p Members
    edited May 2011
    I am also getting problem while clicking the emphasis.
    Following line is generated by the Sahi recorder but fails to click it when I run the test case.
    _click(_emphasis("Save Changes"));

    Does someone got it working?
  • Hello Jessy,

    Please try this instead and check if it clicks it.
    _click(_button("Attribute"));
    

    Regards,
    dkulkarni
  • Adding more info to explain the problem...

    I am using Extjs library and using SplitButton. In this example there are two buttons inside the split button.
    Whenever user opens the screen, one button ”Reload button” is visible with one down arrow at the right hand corner.
    This is how the generated code looks like.
    <td class="x-btn-mc">
    <em unselectable="on" class="x-btn-split" id="ext-gen391">
    <button type="" id="ext-gen233" style="background-image: url("../../Images/reload-entity.png");" class=" x-btn-text">Reload Entity</button>
    </em>
    </td>

    If I click on the button it performs reload action but if I click on “down arrow” at the right hand side then it displays one more option (button) “Back to Search”. I want to click it.
    While recording, Sahi records following sequence but at run time it fails to click the down arrow and instead clicks the “Reload Button” itself.

    _click(_emphasis("Reload Entity"));
    _click(_span("Back to Search"));

    Please suggest how to uncover and click the “Back to Search” button.
  • narayannarayan Administrators
    Try

    _click(_xy(_button("Reload Entity"), -5, 5))

    This forces Sahi to click on the button 5 pixels from the right.

    Regards,
    Narayan
  • SumitraSumitra Members
    Hi chetan5p,

    Try this:

    _click(_xy(_cell("Accessor of the element"),-2,5));

    Regards
    Sumitra
  • Thanks for your suggestion.
    Giving the –X co-ordinate for the button didn’t work but following seems working for me…

    _click(_xy(_byXPath("/html/body/div[2]/…/tr[2]/td[3]"),-2,5));

    I’ll try further to see if this satisfy all my requirements.
    Thanks,
    Chetan
  • narayannarayan Administrators
    Hey Chetan,

    Can you try this?

    _click(_xy(_cell("Reload Entity"), -2, 5));

    This worked on the ext js example page.

    emphasis does not have a valid width property which is why the -2 did not work with emphasis. If you use the outer cell, it will work.

    Regards,
    Narayan
  • Thanks Narayan.
    This also worked.
This discussion has been closed.