narayan

How to Read Text value from Control Window

14 posts in this topic

#1 ·  Posted

Hi Team,

 

I am unable to retrieve the text information present in my control section

Kindly help,I used

#include <MsgBoxConstants.au3>

Run("VIPUIManager.exe")
Local $iPID=WinWait("VIP Access","",3)
WinActivate($iPID,"")
ControlClick($iPID,"","[CLASS:Static; INSTANCE:6]")

ControlFocus($iPID,"","[CLASS:Static; INSTANCE:6]")

ControlGetHandle($iPID,"","[CLASS:Static; INSTANCE:6]")
ControlClick($iPID,"","[CLASS:Static; INSTANCE:6]")

Local $textval=ControlGetText($iPID,"","[CLASS:Static; INSTANCE:6]")
MsgBox($MB_OK,"title",$textval)
WinClose($iPID)

 

Its giving blank for msgbox

 

Thanks

AutoITCaptureText.PNG

Share this post


Link to post
Share on other sites



#2 ·  Posted

what app/website are you trying to automate?

1 person likes this

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites

#3 ·  Posted

ControlGetText is your friend.

 

Saludos

1 person likes this

Share this post


Link to post
Share on other sites

#4 ·  Posted

Hi

Its web application where after providing user details it asks for the security code and the security code can be retrieved from this symantec vip APP only.

 

Kindly help

Thanks

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@Danyfirex Correct me if I'm wrong but didn't he already try ControlGetText in his first post?

 

@narayan I don't see why ControlGetText wouldn't work, since the AutoIt Window Info Tool is able to get the text. If you can't get the text that way maybe an OCR solution would work? Not the best way to handle this of course but it might be worth a try.

Edited by Floops

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Try this:

Run("VIPUIManager.exe")
if WinExists("VIP Access") then 
    $sID = ControlGetText("VIP Access", "", "[CLASS:Static; INSTANCE:6]")
endif
ConsoleWrite($sID & @CRLF)

or

Run("VIPUIManager.exe")
$WW = WinWait("VIP Access")
$hWnd = WinGetHandle($WW)
$sID = ControlGetText($hWnd, "", "[CLASS:Static; INSTANCE:6]")
ConsoleWrite($sID & @CRLF)

or

#include <MsgBoxConstants.au3> 
Run("VIPUIManager.exe")
$WW = WinWait("VIP Access")
$hWnd = ControlGetHandle($WW, "", "[CLASS:Static; INSTANCE:6]")
$focus = ControlGetFocus("VIP Access")
$Text = ControlGetText($focus,"",$hWnd)
MsgBox($MB_OK,"Text", $Text)

Havent tried it.... :P:P:P

Edited by 232showtime
can you show the summary tab of autoit window info tool

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites

#7 ·  Posted

Hello.  This should work.

 

ControlGetText("VIP Access", "", "Static6")

Saludos

1 person likes this

Share this post


Link to post
Share on other sites

#8 ·  Posted

@Floops can you please elaborate more on OCR solution pls.

Share this post


Link to post
Share on other sites

#9 ·  Posted

Have you read the Forum Rules? Seems like this would run afoul of the 2nd bullet point under item 1.

Share this post


Link to post
Share on other sites

#10 ·  Posted

can you show the tab for visible text in autoit window info tool???


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites

#11 ·  Posted

@232showtime hi i tried all your suggestions and dint work.BTW i already used controlGetText

Share this post


Link to post
Share on other sites

#12 ·  Posted

@232showtime hi PFA the screehsot for more details

 

Under Visible Text i see,

 VIP Access
Settings
Minimize
Close
Credential ID
VSST94629495
Copy Credential ID
Security Code
833670
Copy Security code

AutoITIssue.PNG

Share this post


Link to post
Share on other sites

#13 ·  Posted

22 hours ago, Danyfirex said:

Hello.  This should work.

 

ControlGetText("VIP Access", "", "Static6")

Saludos

 

Share this post


Link to post
Share on other sites

#14 ·  Posted

MsgBox(0,"",ControlGetText(" VIP Access","","Static6"))

Saludos

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