Ask a Question

Issue with WaitWPFObject syntax

kflood
Occasional Contributor

Issue with WaitWPFObject syntax

Hello,

 

I'm trying to check if an object exists. I unfortuently keep getting a False when I know its present. Here is the code I'm attempting to use:

 

wpf = 'WPFObject("DataGridRow", "", ' + str(z) + ')'
obj = dataGrid.WaitWPFObject(wpf,1000)
if obj.Exists is True:

    #what I'd like to do because it should be true

 

 

I've confirmed dataGrid is accurate and the z is a loop variable. It fails at 1. In debug mode I confirmed that wpf becomes 'WPFObject("DataGridRow", "", 1)' and the object name is WPFObject("DataGridRow", "", 1) according to object spy. It looks like it's trying to add backslashes in the name.

Am I making a mistake with the syntax here? The language is python.

 

Thank you,

 

Kyle

4 REPLIES 4
Marsha_R
Community Hero

Re: Issue with WaitWPFObject syntax

I don't know python, but I'll give it a try

 

wpf looks like an object but because there are quotes around it, I would say it's a string

 

see if this works for you

obj = dataGrid.WaitWPFObject(eval(wpf),1000)

 

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
sonya_m
Community Manager

Re: Issue with WaitWPFObject syntax

Thank you Marsha!

 

@kflood does this work?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
kflood
Occasional Contributor

Re: Issue with WaitWPFObject syntax

Hi Marsha, I was hoping for a functional test, but I appreciate the input. I'm thinking I'll use the properties of the button to click the button within the coordinates of the parent. Easier said than done, but I'm hoping I can do a functional test without an error or warning. The verification step will be that a window does not pop up after this click. I'll let you all know how it goes.

kflood
Occasional Contributor

Re: Issue with WaitWPFObject syntax

Sorry, this was a response to the wrong post...

cancel
Showing results for 
Search instead for 
Did you mean: