Sign in to follow this  
Followers 0
lifesuxs

Radio button selection help

10 posts in this topic

Hi all,

I am using Autoit for the automation of a webpage. I am doing this on IE. On the webpage there are 2 radio buttons with name "Enabled" and "Disabled". I just want check that which radio button is selected i.e. either Enabled or Disabled, and that should get logged into a notepad file.How could I do it??? please suggest.

Share this post


Link to post
Share on other sites



Can we have the URL? It will be easier to help you.

Share this post


Link to post
Share on other sites

Hello blacksoul305,

acctually it is a wireless home router web interface. there is a feature for DLNA, on the page there are Enable/disable radio buttons for activateing and Deactivating the feature.

Share this post


Link to post
Share on other sites

Okay, I use Chrome so it's the same for Chronium, right click on both radios and you may have "Inspect the element" option. Then, copy-paste the two codes here.

Share this post


Link to post
Share on other sites

here is the code:

<tr height="25">
     <th width="88" align="center" class="body"><div align="left"><strong>DLNA Server&gt;</strong></div>       </th>
     <th width="193" align="center" class="body"><div align="left">
                <input name="dlna_enabled" type="radio" value="1" checked> Enable
      <input name="dlna_enabled" type="radio" value="0" > Disable </div></th>
     <th width="315" align="center" class="body">&nbsp;</th>
   </tr>

note: both radio buttons have same name "dlna_enabled"

Share this post


Link to post
Share on other sites

What is that? Same name but no ID. Well, at least we can see that when it is "disabled", value = 0 and value = 1 when its "enabled".

No idea...

Share this post


Link to post
Share on other sites

I have tried this out using values of 0 and 1 but result is alway the first radio button i.e. Enabled no matter the feature is disabled at the moment.

I used the function _IEFormElementGetValue. Do you have any idea what fuction could be used in order to get "checked" values as you could see this in code.

Share this post


Link to post
Share on other sites

Well, I just need the ID of both radios, we were able to use _IEGetIdByName but they've got the same name.

From IDs, we can make a condition thanks to _IEFormElementGetValue and then check which radio's checked.

Not I'm stuck. Haha !

Share this post


Link to post
Share on other sites

Thanks pal.

Share this post


Link to post
Share on other sites

Have you looked at _IEFormElementRadioSelect and its examples?

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0