Sign in to follow this  
Followers 0
zerbra

Cannot select the correct radio button using _FFFormRadioButton

4 posts in this topic

#1 ·  Posted (edited)

Hi! I'm having problem about selecting the correct radio button in FF. I've attached the offline website to this topic.

As you can see in this website, there are 9 groups of radio button, each radio group is labeled by a name, each radio button in a group is distinguished by its value. So the option "It matches" on group 2 will have the name "name_of_group_2" and value "4" which is unique for option "It matches" on any group.

But although I've tried serveral method, the solution doesn't seems to work:

_FFFormRadioButton("4", 1, "value") ;if I want to choose "It matches" on group 2 (the second "It matches" is situated on group 2)

or 

_FFFormRadioButton("name_of_group_2", 0, "name") ;if I want to choose "It matches" which its index is zero on the group named name_of_group_2

Any help is very appreciated :) Thanks guys

p/s: I founded that this website doesn't work well in IE 8, if you guys still running XP please give it a try to see if this correct to you or it's just me. I wanted to work with  this website using _IE but since this problem happened, that seems impossible. :(

website.rar

Edited by zerbra

Share this post


Link to post
Share on other sites



in this thread

'?do=embed' frameborder='0' data-embedContent>>

I tackled it with syntax like

const $cSearchButton="name:=Search.*; indexrelative:=3"

not exactly what you look for but in the example 1 of that thread you see how I iterate over all objects in a window so you could use that to make some logic to only identify AFTER a starting element is found

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi junkew, thanks for reply. The fact is that I'm an amateur in computer programming so I hardly understand what is starting element. Just to be clear that I just following the formula of the function when the problem occured.

I see that your module can manipulate chrome and firefox, and I'm trying to learn how to use it. But when I run Example 1, Autoit keeps telling me that variable must be of type "Object". Any clue here?

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
Title=D:\My Documents\Downloads\EXAMPLES\ex1_Treewalker.au3 - SciTE [4 of 4]    Handle=0x005102D6
Title=EXAMPLES  Handle=0x003C0474
Title=IUIAutomation MS framework automate chrome, FF, IE, .... - Example Scripts - AutoIt Forums - Google Chrome    Handle=0x007D021C
Title=Include   Handle=0x005F03D2
Title=Lich thi cac lop chinh quy Hoc ky 2 nam hoc 2013-2014 - PDF-XChange Viewer    Handle=0x007F011A
Title=Program Manager   Handle=0x00010086
initializing tw 1
"D:\My Documents\Downloads\EXAMPLES\ex1_Treewalker.au3" (53) : ==> Variable must be of type "Object".:
If $t = 1 Then $UIA_oUIAutomation.RawViewWalker($UIA_pTW)
If $t = 1 Then $UIA_oUIAutomation^ ERROR
->22:05:17 AutoIt3.exe ended.rc:1
+>22:05:17 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 0.9186
Edited by zerbra

Share this post


Link to post
Share on other sites

If you are a starter I think those libraries and hierarchies of elements can be very confusing

download the zip of the 1st post in that thread with all examples in it. The ones in the thread are not updated.

  • Compare it with a tree one root which has many twigs (which can be split again in new twigs) and in the end you have the leafs
    Mostly on all GUI frameworks there is a top level object (for example desktop)
    Then below that you have all the application objects
    and within each application object you have another hierarchy of objects.
    When your application is HTML oriented there are many levels of nesting
  • within the different UDF's like FF.AU3, IE.AU3, CHROME.AU3 and UIAUTOMATION you have different ways of walking / iterating thru the tree.normally it starts at a twig

 

  • So you basically allways have to start with the desktop to find the child applications.

 

  • As HTML is frequently having many hierarchies below the main application window its not allways easy to find the correct way thru.

 

 

  • For your problem you do start at a twig to search but later on you then need to program do not find me object 3 in that twig but continue search after you have found another object
  • As soon as you understand example 1 jump to example 7 which tells you a little about how to handle firefox

 

This can dump your tree of the firefox hierarchy with some basic information about each element

;~ Find the FF window
$oFF=_UIA_getFirstObjectOfElement($UIA_oDesktop,"class:=MozillaWindowClass", $treescope_children)
if not isobj($oFF) Then
    _UIA_DumpThemAll($UIA_oDesktop,$treescope_children)
EndIf


;~ Make sure firefox is front window
$oFF.setfocus()

if isobj($oFF) Then
        _UIA_DumpThemAll($oFF,$treescope_subtree)
EndIf

 

 

 

 

 

 

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