Sign in to follow this  
Followers 0
Athos

Selecting an element without a form

5 posts in this topic

Hi guys, I'm new to autoit, but so far I love using it and have been having a blast working on test automation with it.

However, I've hit a snag, in that I need to select an option from a select that displays on a page, but the select for whatever reason is not located within a form.

At first I assumed this was wrong, but after double checking with _IEFormGetCollection, none of the forms

contained the select I need to access.

So my question is, how do I select this option, so that I might move on with my script, when the select is not part of a form. I've tried using _IE action, and I've had little success so far.

Thank you,

Athos

Share this post


Link to post
Share on other sites



You need to provide the HTML of the page in question. You might be able to retrieve it using _IEGetObjById or _IEGetObjByName.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

for the sake of protecting the information on the page i'm going to change a few names:

<span class="smpGroupItemLabel">Selectotheright:</span> <SELECT ID='X' NAME='X' onchange="javascript:setSimpleGroupRuleOption('CO', 'C_D', this.options[this.selectedIndex].value,'D')" ><option id="This is the option that I want" value="All">All</option>

Edited by Athos

Share this post


Link to post
Share on other sites

Thanks zorphnog! That worked like a charm ;)

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

    • BlazerV60
      By BlazerV60
      Hello all,
      I've been trying to figure out how to launch Google Chrome in the background (hidden) but it doesn't seem possible. I've tried the following methods:
      ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "", "", "", @SW_HIDE) Also I've tried:
      ShellExecute(@ComSpec, "/c start chrome.exe","","",@SW_HIDE) Lastly I tried:
      RunWait('"'&@ProgramFilesDir&'\Google\Chrome\Application\chrome.exe" --silent-launch',@ScriptDir)  
      But all of them launch my chrome browser without hiding it. Does anyone know a workaround for this or if AutoIT just can't Chrome? 
      Bonus points if you know how to make it launch chrome hidden and make it go to https://www.autoitscript.com
       
      Thank you,
      Brian
    • 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!
    • BOUNCER
      By BOUNCER
      I'm trying to get the output data from https://www.guilded.gg but it uses a web app that generates that output on the fly and this doesn't show up in the page source.
      Only in web inspector of each browser does this data show up. How do I read this data in autoit (equivalent to the web inspector)
       
      thank you
    • 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!!