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.

Get font color value

lonely_girl01lonely_girl01 Members
edited April 2013 in Sahi - Open Source
Hi,

Can anyone help me in getting the color value of the font HTML element:
<tr>
<td><font color="#CC0000">Discount</font></td>
</tr>


Thanks.

Best Answer

  • edited June 2013 Answer ✓
    Hi Charmaine,
    Please follow these steps:

    1) open the file :
    sahi_pro/htdocs/spr/concat.js
    

    2) search for the function : prepareADs()

    3) add the following line at the end of the function:
    this.addAD({tag: "FONT", type: null, event:"none", name: "_font", attributes: ["sahiText", "color", "face", "size"], action: "none", value: ""});
    

    4) save the js file.

    5) open the file:
    sahi_pro/config/normal_functions.txt
    

    6) add _font at the end of the txt file.

    7) save the text file.

    8) restart sahi.

    You can now get the colour of the above element by :
    [code] _font("discount").color [code]

    If you still face any problems, please let me know.

    Regards.

Answers

  • _log(_font($_DIV_LEARNING_PATH).color);

    I have tried about steps to get Font color for DIV objects but getting error saying cannot read property Can you please help?

    Kamal Baldawa
  • _log(_font($_DIV_LEARNING_PATH).color);

    I have tried about steps to get Font color for DIV objects but getting error saying cannot read property Can you please help?

    Kamal Baldawa
Sign In or Register to comment.