Danp2 Posted April 16, 2014 Share Posted April 16, 2014 The correct syntax for _FFFormRadioButton is _FFFormRadioButton($vRadioButton[, $iRadioButtonIndex = 0[, $sRadioButtonMode = "index"[, $vForm = 0[, $sFormMode = "index"]]]]) Your example translate to this: $vRadioButton = "2291037996" $iRadioButtonIndex = 0 $sRadioButtonMode = "account" $vForm = "form" $sFormMode = "switch_primary_form" Your last three parameters are wrong, which is causing the command to fail. These are the valid options for those parameters: $sRadioButtonMode Optional: Mode of the radio-button selection: index = (Default) Index (0-n) of the radio-button. name = Name of the radio-button. id = ID of the radio-button. value = Value of the radio-button. $vForm Optional: Index (0-n), name or ID of the form. 0 = (Default) $sFormMode Optional: Mode of the form selection.: index = (Default) Index (0-n) of the form. name = Name of the form. id = ID of the form. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
BrewManNH Posted April 16, 2014 Share Posted April 16, 2014 Danp2, don't bother, he'll keep coming back until you write it for him. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Arclite86 Posted April 17, 2014 Author Share Posted April 17, 2014 Thanks Danp2, for helping me, I have read your explanation very carefully and this is what I got $vRadioButton Name, ID or value of the radio-button. $iRadioButtonIndex Optional: Index of the radio-button (0-n) 0 = (Default) $sRadioButtonMode Optional: Mode of the radio-button selection: index = (Default) Index (0-n) of the radio-button. name = Name of the radio-button. id = ID of the radio-button. value = Value of the radio-button. $vForm Optional: Index (0-n), name or ID of the form. 0 = (Default) $sFormMode Optional: Mode of the form selection.: index = (Default) Index (0-n) of the form. name = Name of the form. id = ID of the form. $vRadioButton = "2291037996" $iRadioButtonIndex = 0 $sRadioButtonMode = "input" $vForm = "form" $sFormMode = "switch_primary_form" _FFFormRadioButton("2291037996",0,"input","form","switch_primary_form") the form html source: <form id="switch_primary_form" class="bigradioform" method="post" action="switch_primary"> <input class="bigradio" type="radio" checked="checked" value="363596699" name="account"></input> <strong></strong> <br></br> <input class="bigradio" type="radio" value="2291037996" name="account"></input> @followbacklist6 <br></br> <br></br> <br></br> <a class="btn btn_smaller btn_gray inline_block" href="/account/manage_owned"></a> <a class="btn btn_smaller btn_blue inline_block btn_submit_form" href="#"></a> </form> this is the message that i get in the console: __FFStartProcess: ""C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -new-window "http://tweepi.com/account/switch_primary" "-repl 4242 " _FFConnect: OS: WIN_81 WIN32_NT 9600 _FFConnect: AutoIt: 3.3.10.2 _FFConnect: FF.au3: 0.6.0.1b-10 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 828 _FFConnect: Browser: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 __FFSendJavaScripts: Sending functions to FireFox .......... done _FFLoadWait: . loaded in 11ms [object XrayWrapper [object HTMLDocument]] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...} _FFFormCheckBox ==> Invalid value: (index|name|id) $sFormMode: switch_primary_form its keeps saying that the $sformMode is incorrect, $sformMode= Optional: Mode of the form selection.: index = (Default) Index (0-n) of the form. name = Name of the form. id = ID of the form. the id of the form is "switch_primary_form" or am i wrong? BrewMaNH if you dont have anything usefulls to say than be quiet, cant you see im trying! Link to comment Share on other sites More sharing options...
Danp2 Posted April 17, 2014 Share Posted April 17, 2014 $sFormMode sets the mode of the form selection, and the only allowable values are index, name, or id. $vForm needs to contain the form identifier (it's actual index, name or id) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Arclite86 Posted April 17, 2014 Author Share Posted April 17, 2014 $sFormMode sets the mode of the form selection, and the only allowable values are index, name, or id. $vForm needs to contain the form identifier (it's actual index, name or id) ok, but the form= <form id="switch_primary_form" class="bigradioform" method="post" action="switch_primary"></form> so the identifier of the form = id:switch_primary_form but why is it keep saying that its a invalid value, sorry, I am trying to understand it but im a little confused Link to comment Share on other sites More sharing options...
Danp2 Posted April 17, 2014 Share Posted April 17, 2014 _FFFormRadioButton("2291037996",0,"input","form","switch_primary_form") This is what you previously posted. The 5th parameter ($sFormMode) is the form id ("switch_primary_form"), which actually should be passed as the 4th parameter ($vForm). Then you need to pass the proper value for the 5th parameter. With this correction in place, which of the following do you think needs to be passed as $sFormMode: index, name, or id? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Arclite86 Posted April 18, 2014 Author Share Posted April 18, 2014 _FFFormRadioButton("2291037996",0,"input","form","switch_primary_form") This is what you previously posted. The 5th parameter ($sFormMode) is the form id ("switch_primary_form"), which actually should be passed as the 4th parameter ($vForm). Then you need to pass the proper value for the 5th parameter. With this correction in place, which of the following do you think needs to be passed as $sFormMode: index, name, or id? I thought the proper value for the 4th parameter would be the 5th parameter the "form" _FFFormRadioButton("2291037996",0,"input","switch_primary_form","form") but that didnt work either, could you please help, its not that i didnt tried I have tried it for hours this is what i all tried _FFFormRadioButton("account",0,"input") _FFFormRadioButton("account",0,"2291037996") _FFFormRadioButton("account",0,"input","switch_primary_form") _FFFormRadioButton("account",0,"input","switch_primary_form","bigradioform") _FFFormRadioButton("account",0,"input","switch_primary_form","form") _FFFormRadioButton("2291037996",0,"input","switch_primary_form","form") _FFFormRadioButton("2291037996",0,"input","form","switch_primary_form") _FFFormRadioButton("2291037996",0,"input","switch_primary_form","switch_primary_form") _FFFormRadioButton("2291037996",0,"input","switch_primary_form","2291037996") _FFFormRadioButton("2291037996",0,"input","switch_primary_form","input") _FFFormRadioButton("2291037996",0,"input","switch_primary_form","form") _FFFormRadioButton("2291037996",0,"input","switch_primary_form","@followbacklist6") _FFFormRadioButton("2291037996",0,"input","switch_primary_form","account") _FFFormRadioButton("2291037996",0,"input","switch_primary_form","switch_primary") Link to comment Share on other sites More sharing options...
Danp2 Posted April 18, 2014 Share Posted April 18, 2014 You didn't answer my question: With this correction in place, which of the following do you think needs to be passed as $sFormMode: index, name, or id? You are still passing the wrong value for the $sFormMode parameter. It will only accept one of these literal strings: "index", "name", or "id". Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Arclite86 Posted April 18, 2014 Author Share Posted April 18, 2014 You didn't answer my question: You are still passing the wrong value for the $sFormMode parameter. It will only accept one of these literal strings: "index", "name", or "id". ok sorry, I think the "id" because its right after the <form and I see no "name",but when i try it its says :invalid valua every time.. Link to comment Share on other sites More sharing options...
Danp2 Posted April 18, 2014 Share Posted April 18, 2014 So you get an invalid value response with the following? _FFFormRadioButton("2291037996",0,"value","switch_primary_form", "id") Look at the changes I made to the 3rd and 5th parameters. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Arclite86 Posted April 18, 2014 Author Share Posted April 18, 2014 (edited) So you get an invalid value response with the following? _FFFormRadioButton("2291037996",0,"value","switch_primary_form", "id") Look at the changes I made to the 3rd and 5th parameters. omg I thought I had to find the id of the form instead of just typing it, thank you, maybe its too much for ask but is there a way i can get the radio-button by telling the name instead of the number "2291037996" but as you see the name is not an value or id but it is just text "@followbacklist6" <br></br> <input class="bigradio" type="radio" value="2291037996" name="account"></input> @followbacklist6 <br></br> Is it possible to select this radiobutton by the text name??. because that would make it much easier instead of looking up the number ( that chances daily) al the time Edited April 18, 2014 by Arclite86 Link to comment Share on other sites More sharing options...
Danp2 Posted April 18, 2014 Share Posted April 18, 2014 I thought I had to find the id of the form instead of just typing it You were already supplying the form ID as the 4th parameter. You needed to pass "id" as the 5th parameter, which tells the function how to handle the value you passed as the 4th parameter. Same thing for the 1st / 3rd parameter combination. maybe its too much for ask but is there a way i can get the radio-button by telling the name instead of the number "2291037996" but as you see the name is not an value or id but it is just text "@followbacklist6" This could be done, but you would first have to determine which radio button you want to select within the group. $i = 0 ; Select the first radio button _FFFormRadioButton("account",$i,"name","switch_primary_form", "id") $i = 1 ; Select the second radio button _FFFormRadioButton("account",$i,"name","switch_primary_form", "id") ; etc Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Arclite86 Posted April 18, 2014 Author Share Posted April 18, 2014 You were already supplying the form ID as the 4th parameter. You needed to pass "id" as the 5th parameter, which tells the function how to handle the value you passed as the 4th parameter. Same thing for the 1st / 3rd parameter combination. This could be done, but you would first have to determine which radio button you want to select within the group. $i = 0 ; Select the first radio button _FFFormRadioButton("account",$i,"name","switch_primary_form", "id") $i = 1 ; Select the second radio button _FFFormRadioButton("account",$i,"name","switch_primary_form", "id") ; etc Thank you very much Danp2, I now understand how this function works have a nice day Link to comment Share on other sites More sharing options...
Arclite86 Posted April 20, 2014 Author Share Posted April 20, 2014 (edited) why is this working: $i = 1 _FFFormRadioButton("account",$i,"name","switch_primary_form", "id") and this is not? $i = GUICtrlRead($input) ;Input is showing number "1" _FFFormRadioButton("account",$i,"name","switch_primary_form", "id") Edited April 20, 2014 by Arclite86 Link to comment Share on other sites More sharing options...
Solution Danp2 Posted April 20, 2014 Solution Share Posted April 20, 2014 Doesn't work is not an adequate description of the problem. Post the results from the Scite output window. Hint: You probably need to convert the value to a numeric using Number(). Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Arclite86 Posted April 20, 2014 Author Share Posted April 20, 2014 (edited) Doesn't work is not an adequate description of the problem. Post the results from the Scite output window. Hint: You probably need to convert the value to a numeric using Number(). Thanks i got it! Local $i = GUICtrlRead ($input) _FFFormRadioButton("account", Number($i),"name","switch_primary_form", "id") Edited April 20, 2014 by Arclite86 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now