Jump to content

Recommended Posts

Posted

I want to automate an application in which there is a tree view. The tree view is of two level i an able to fetch node of first level but not able to fetch node of second level. Tree structure is -

Team1

-emp1

-emp2

Team2

-emp1

-emp2

I have tried following code working 

$idTreeView = ControlGetHandle("Select Users","","WindowsForms10.SysTreeView32.app.0.378734a1")
$hItemFound1 = _GUICtrlTreeView_FindItemEx($idTreeView, "Team1")

but following is not working 

$idTreeView = ControlGetHandle("Select Users","","WindowsForms10.SysTreeView32.app.0.378734a1")
$hItemFound1 = _GUICtrlTreeView_FindItemEx($idTreeView, "Team1/emp1")

I think the path i am providing is wrong. So please tell me how to find path of sub node.

I have also tried following code for path.  In my case no node is selected so it always returns path as  Team1

which is first outer node of my tree

$selection = _GUICtrlTreeView_GetSelection($idTreeView)
$txt = _TreePath($idTreeView,$selection)

Please help i am new in autoit

 

Posted
Posted

I have solved the problem by putting "|" symbol instead of "\". I am able to get handle of desired node but now i am facing problem to select it( there is check box associted with each node). bellow is the code

$idTreeView = ControlGetHandle("Select Users","","WindowsForms10.SysTreeView32.app.0.378734a1")
$hItemFound = _GUICtrlTreeView_FindItemEx($idTreeView, "Team1|emp1")    

controlClick("Users", "",$hItemFound )

Posted

Solved 

$idTreeView = ControlGetHandle("Select Users","","WindowsForms10.SysTreeView32.app.0.378734a1")
$hItemFound = _GUICtrlTreeView_FindItemEx($idTreeView, "Team1|emp1")
_GUICtrlTreeView_ClickItem($idTreeView, $hItemFound, "left", False)

send{SPACE},false)

Posted
Posted (edited)

I do not know if you saw it but this is not standard Win32 GUI controls, but .NET

$idTreeView = ControlGetHandle("Select Users","","WindowsForms10.SysTreeView32.app.0.378734a1")

I think you should start reading here:
https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/

 

 

btw.

@Akashrai please read this: How to post code on the forum 

EDIT: and
Welcome to the forum.

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Today morning i executed the bellow code but it is not working. I was working before 3-4 days. 

$idTreeView = ControlGetHandle("Select Users","","WindowsForms10.SysTreeView32.app.0.378734a1")
$hItemFound1 = _GUICtrlTreeView_FindItemEx($idTreeView, "Team1")

i do not know what goes wrong please help. 

 

    

 

 

 

Edited by Akashrai
Posted (edited)
  On 12/7/2015 at 8:09 PM, mLipok said:

I do not know if you saw it but this is not standard Win32 GUI controls, but .NET

I thought the same thing at first, but after re-reading the OP, he said his first part of code works...to my surprise.  I haven't had much chance/opportunity to interact with .NET applications/controls, but I don't remember it being that easy before. I'm suppose it compatible as it's calling WinForms--which is what the standard controls are I believe AutoIt supports I believe--instead of WPF or some other UI toolset.

Anyways, sounds like he sorted it out with 32 vs 64.

Edited by spudw2k

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...