Sign in to follow this  
Followers 0
Servant

How to select the radio button that doesn't have a radio group's name or ID?

2 posts in this topic

#1 ·  Posted (edited)

How to _IEFormElementRadioSelect a radio button that doesn't have a radio group's name or ID?

_IEFormElementRadioSelect($o_object, $s_string, $s_name)

<fieldset class="share-item">
      <legend>share a link or news</legend>

      <div class="share-item-types"><span class="radio-group-label">Discussion type:</span>
        <span class="radio-group">
        <input type="radio" class="fancy" id="discussion-type-general" name="forumtype" value="7" checked="true" tabindex="0"><label class="radio-label" for="discussion-type-general">General</label>

        <input type="radio" class="fancy" id="discussion-type-job" name="forumtype" value="5" tabindex="0"><label class="radio-label" for="discussion-type-job">Job</label>

        <input type="radio" class="fancy" id="discussion-type-promotion" name="forumtype" value="8" tabindex="0"><label class="radio-label" for="discussion-type-promotion">Promotion</label>
        </span>
      </div>

      <div class="share-item-group">
          <input type="hidden" value="0" name="contentImageCount" id="share-img-total">
          <input type="hidden" value="-1" name="contentImageIndex" id="share-img-selected-idx">
          <input type="hidden" value="" name="contentImage" id="share-img-selected-url">
          <input type="hidden" value="" name="contentEntityID" id="share-entity-id">
          <input type="hidden" value="" name="contentUrl" id="share-entity-url">

          <div id="share-mode" class="share-mode">
            <div class="share-loading"></div>

            <div id="share-view" class="share-preview"></div>

            <div class="share-edit">
              <ul id="share-edit-list" class="form">
                <li id="share-edit-title-wrapper">
                    <input type="text" name="contentTitle" value="" id="share-edit-title" tabindex="0" class="text share-edit-title" maxlength="70">
                </li>
                <li id="share-edit-meta"></li>
                <li id="share-edit-summary-wrapper">
                    <textarea name="contentSummary" id="share-edit-summary" tabindex="0" class="text" maxlength="250"></textarea>
                </li>
                <li id="share-include-photo-wrapper">
                    <input type="checkbox" name="contentImageIncluded" value="true" id="share-include-photo" class="check" checked="checked" tabindex="0">
                    <label for="share-include-photo">Include Photo</label>
                </li>
                <li>
                  <input type="button" name="#" value="Save" class="btn-primary" id="share-edit-submit" tabindex="0">
                  or
                  <a href="#" tabindex="0" id="share-edit-cancel">Cancel</a>
                </li>
              </ul>
            </div>

          </div>

            <div class="post-actions">
            <div class="post-actions-row">

            <div class="submit">
                <input type="submit" name="postItem" value="Share" class="btn-primary share-submit disabled" id="share-submit" tabindex="0" disabled="">
            </div>
          </div>
          </div>
      </div>
    </fieldset>

This is what I want to select:

<input type="radio" class="fancy" id="discussion-type-job" name="forumtype" value="5" tabindex="0"><label class="radio-label" for="discussion-type-job">Job</label>
Edited by Servant

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

id="discussion-type-job"

and the radio group is

name="forumtype"

should look something like this:

_IEFormElementRadioSelect($oForm, "Job", "forumtype", 1, "byValue", 1)
Edited by Kidney
1 person likes this

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

  • Similar Content

    • Spask
      By Spask
      Hi, I'm trying to find a text value inside of a html.
      This is what the line looks like normally:
      <p id="line1" class> <span class="bot">TEXT HERE</span> </p> The text then changes to a non breaking space:
      <p id="line1" class> <span class="bot">&nbsp;</span> </p> And then it changes back to normal text but it's different every time.
      Can I code this so that it grabs the text every time it changes and has a variable that represents it?
      I currently have this inside of my loop:
      $span = .document.getElementsByTagName("span") For $text In $span If $text.value = "&nbsp;" Then Sleep(50) MsgBox(0,0,0) ;messagebox to test if it can be found, but I don't know how to grab the text EndIf Next The problem is that there are many other lines in the html that have the same span but are called "line3", "line5", etc and the one I need is from "line1".
      I will appreciate if anyone can help with this!
    • electrons
      By electrons
      hi  , hope  you all doing well 
       cant find any elements on the page ?  and the right click mouse dont work too?
      iam trying with more than method , i need help please!!
       

    • ur
      By ur
      I have kept below line to wait for IE to load the site completely and continue.
      _IELoadWait($oIE)
       
      But, the code is continuing without waiting for it and I my execution is failing as the elements are not loaded completely.

       
      Any suggestions for alternate code to wait for the browser to load completely?
       
    • ur
      By ur
      We can select elements in IE using their IDs as below.
      Local $oDiv = _IEGetObjById($oIE, "x-auto-16-input") But to one button in the webpage, there is no ID to it.
      In selenium we have option to select this element using the CssSelector and clicked the button using below code in c# selenium.
      driver.FindElement(By.CssSelector("button.x-btn-text")).Click(); What is the alternative for this in AUtoIT?