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.

radiobutton value changes

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

I have a radio button "_radio("_handle[83152][status]" where the call_handling[no]

changes every time..I need to get the value of the call handling every time...

and then verify for checked/not....

Can anybody help me.....

Comments

  • narayannarayan Administrators
    Are there a lot of radio buttons on the page? Is it possible to use _near or _in to get to the radio button?

    Regards,
    Narayan
  • adsads Members
    thanks for the reply...

    Yes there is a radio button _radio("handle[83152][status]") above it which is constant.

    Here when we create with a new handle the value is new(can't assume) and gets added up.So I

    need to get the value every time after creation...

    Could u explain me the _near or _in, since I am new to this tool?
  • narayannarayan Administrators
    Hi,

    Have a look at DOM Relations in Browser Accessor APIs: http://sahi.co.in/w/browser-accessor-apis

    It explains how to use _in and _near to get to elements whose ids are not constant.

    For example, the textarea near "Write message:" on this screen can be accessed by
    _textarea(0, _near(_span("Write message:")))

    It may be easier if you post the HTML of the section containing the radio buttons, for us to understand the structure better.

    Regards,
    Narayan
  • adsads Members
    Yes this is good.....the near and in...

    it worked out fine with
    _assertNotTrue(_radio(/call_handle/, _near(_link("My default rules")).checked));

    Narayan this is for the nearest(radio) one to My default rules link...but for 2nd and 3rd links not working out...

    like for _assertNotTrue(_radio("/call_handle/[1]", _near(_link("My default rules")).checked));

    _assertNotTrue(_radio("/call_handle/[2]", _near(_link("My default rules")).checked));
  • narayannarayan Administrators
    Looks like the brackets are incorrect. Should have been:

    _assertNotTrue(_radio(/call_handle/, _near(_link("My default rules"))).checked);
    _assertNotTrue(_radio("/call_handle/[1]", _near(_link("My default rules"))).checked);
    _assertNotTrue(_radio("/call_handle/[2]", _near(_link("My default rules"))).checked);
Sign In or Register to comment.