Sign in to follow this  
Followers 0
bombProofShark

Getting text from newest item in a SysListView32

2 posts in this topic

Hello,

Have never posted any thing before so I will apologize ahead of time if my question is not asked correctly.

I am Automating some functional test cases for work and would love to be able to get the text from a windows list view box, to be stored as a string for comparison in the following function.

I attempted to use ControlGetText with no luck.

func setbaseNameGreaterThenMax()

$bName = ""

WinActivate( "Reply Plus Test Application")

_TabMoveTo(1)

ControlSetText("Reply Plus Test Application" , "", "[Name:txtSystemBaseName]", "12345678901234567890123456")

ControlClick( "Reply Plus Test Application" , "", "[Name:btnSystemBaseName]")

sleep(1000)

$bName = ControlGetText("Reply Plus Test Application" , "", "[Name:lsvDebugError]")

ControlClick( "Reply Plus Test Application" , "", "[Name:btnDebugErrorClear]")

_TabMoveTo(1)

dissconnectUsbBase()

connectToUsbBase()

if $bName <> "B73391: 15:18:45:010: Invalid BaseName. BaseName may not be empty nor exceed 24 characters." Then

MsgBox(0, "Test Failed", "Api Failed to throw an error.")

EndIf

EndFunc

The attached file contains a screen shot of the application i am controlling, i need to get the red text.

If someone could please point me in the right detection, it would be great.

here is the window info for the list view box:

>>>> Window <<<<

Title: Reply Plus Test Application

Class: WindowsForms10.window.8.app.0.2bf8098_r13_ad1

Position: 269, 28

Size: 1024, 770

Style: 0x16CF0000

ExStyle: 0x00050100

Handle: 0x000609C6

>>>> Control <<<<

Class: WindowsForms10.SysListView32.app.0.2bf8098_r13_ad1

Instance: 3

ClassnameNN: WindowsForms10.SysListView32.app.0.2bf8098_r13_ad13

Name: lsvDebugError

Advanced (Class): [NAME:lsvDebugError]

ID: 197220

Text:

Position: 28, 50

Size: 949, 455

ControlClick Coords: 498, 54

Style: 0x56114141

ExStyle: 0x00000200

Handle: 0x00030264

>>>> Mouse <<<<

Position: 803, 162

Cursor ID: 0

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Debug/Error

Auto Scroll

Keypads

Clear

>>>> Hidden Text <<<<

System

Set

4000

Keep Alive Timeout:

3.18.4441.18919

Test App Version:

Keep Alive

Connected

Disconnect

Get Bases

Ethernet

Pass:

Mid High

Low

Set

00

Session Group:

Set

Big

3.07

1.46

Dynamic

Authenticate

Login Enabled

Set

WRS970

21

Set

12345678901234567890123456

Debug

Address Mode:

Power Level:

Avoid Wifi:

Comm Timeout:

Session Name:

Base Name:

Base ID:

Control Version:

Base Version:

Base Model:

Connect

B73391-123456789012345678901234

Bases:

Keypads

Backlight

Two

Normal

Timer:

Operation Method:

Always On

Behavior

Receive Arrow Any Group

0000

Disabled

Off

Ten

Beep Keypads

Force Menu

Beep Out of Range

Power Down

Power Timer:

Set

Menu Access:

SMS Vote Timeout:

Ping Timer:

Login/Logout

ID:

All

Secure Login

Logout

Auto Connect

Display

Show Sending

Show Received

Keys

Start Symbol:

Key Locked Feedback

Hide Vote

Alert Enabled

Power Key Disabled

Softkey Text:

Set

Messaging

Send All

Message Ack

Serial #/ ID:

Message:

Send

Scroll Faster

Icons

Hide Antenna

Hide Battery

Receive Any Group

Keypad List

Test

In List?

All Grps

Clear

Set

500

Max Keypads:

Static

Dynamic

Remove

Add

Serial #:

Fill

Questions

001

Begin

Show

Set

Lock Keys

All

Symbol

Soft Center

Soft Right

Soft Left

Link

Scan

Alert

Key0

Key9

Key8

Key7

Key6

Key5

Key4

Key3

Key2

Key1

Answer:

Custom Message:

Line One Prompt:

Answer Type:

Question #:

Automate

Votes

Clear

Details

Details Only

Clear

M to M

Moment To Moment

Training

Base Training

US Max

Power Level:

Normal

Set

Base Mode:

Clear

Training Requests:

Keypad Validation:

post-71526-0-98998300-1334178179_thumb.p

Share this post


Link to post
Share on other sites



Well, if you downloaded the full installation of scite4autoit, in the tools menu there is an entry that reads "au3nfo", click it to bring up the window tool and select the little cross hairs and hover it over the list view and check if you can grab its text and try using it to determine why your script isn't working...

Also, you could try editing your initial post and put the code in code tags, it's a little blue icon in the post form..


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

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