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 use _near() and combo box name is like - "academicYear[8].allow

devendra_kumar1devendra_kumar1 Members
edited November -1 in Sahi - Open Source
Hi,

I am creating a script using SAHI where i have multiple combo box having values "Yes" & "No" and following naming conventions-

->_setSelected(_select("academicYear[8].allowcheckout"), "Yes");

How to user _near() for this component.

I tried the following statements but it did not work -

_setSelected(_select("academicYear", _near(_label("2013-2014")), ".allowcheckout","Yes"));

_setSelected(_select("academicYear, _near(_label("2013-2014")), .allowcheckout","Yes"));

please help.

Thanks
Devendra Kumar

Comments

  • Hi devendra

    maybe regular expressions could help:
    _setSelected(_select("/academicYear/", _near(_label("2013-2014"))), "Yes");
    though, I dont really know if .allowcheckout serves any function or if its just a name.
    Hope this makes any sense

    regards
    Wormi
  • it worked :)
    Thanks a lot Wormi,
  • narayannarayan Administrators
    Thanks Wormi!

    Devendra Kumar, as a general point to note, [8] here is not added by Sahi. It already exists in the actual html identifier (in your web page's html). When Sahi adds an index, it will always be at the end of the string.

    Regards,
    Narayan
Sign In or Register to comment.