11 Replies - 7688 Views - Last Post: 17 June 2013 - 03:51 AM Rate Topic: -----

#1 Tomeki  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 12-December 11

[SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 12 December 2011 - 05:27 PM

Hi Guys,

Intro:
So I have a application which I want to control/automate

I checked the Window/Controls with Spy++ and it seems the App is written in C++(/MFC?), so I started with p/invoke and write my code using my implentation of SendMessage & Listview and LVM etc. at a certain point I got stuck and posted my problem into a different forum. The solution or Tip the person gave me to use already existing frameworks for UI automation like "White".
So I started over with white and it was way easier to solve the things with white than manually by hand (Like modal windows and MDI child etc.)

Problem:
The problem in the first place was that most of the windows have no title at all, so looking for the right window is/was a pain in the ass, same for the controls which i could not find/see in SPY++ (now i am using UIVerify which does a better job). However White is hooking into the programs message queue to find windows/items, this is a big performance problem
which can be noticed in my automation - simple steps like performing a click on a button take several seconds, to fillout a form and click send button several minutes (the more items i have to check/fill out, the longer it takes)

Questions
* Is there any way to improve the speed with white?
* are there any other frameworks for C# .NET which i could use and may do a better/faster job ?
* Any other suggestion how I could solve the problem?
* hmm ???

P.S.
I also hooked into the keyboard to improve the speed in menus with sending tabs and returns which is faster than performing the programmatic clicks with white. However at certain controls like comboboxes it did not work (changing the selected item) so i had to use white again which took ages :(

In theory i could hook into the mouse and just record my clicks and play them BUT then we have the problem for example if items in a combobox changes then the location/position of the item i want to click may change
and then my script wont work as it should -_-

Don't suggest AutoIt3 because i am NO fan of it especially because what you can do with AutoIt3 you can do in C# aswell .. AutoIt3 is just a wrapper of the WinAPI for those script kiddies...unless you can convince me...

Is This A Good Question/Topic? 0
  • +

Replies To: [SOLVED] C# UIAutomation / White Framework - Performance / Help

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5481
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 12 December 2011 - 06:18 PM

If this were you own program you were trying control then you wouldn't have to go through these games.

Which means you're trying to hack someone else's program. You're not likely to get much help here with that sort of thing. We don't like it when our programs are hacked or pirated so we don't help newbies do it to other people's intellectual property.
Was This Post Helpful? 0
  • +
  • -

#3 Tomeki  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 12-December 11

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 12 December 2011 - 06:25 PM

Seriously are you kidding me?

Yes it is a third party application and NO it is not a pirated application, game or any illegal attempt. I have my procedure which i want to automate - what's wrong about that ?!

There is a UIAutomation implemented since .Net 3.0 (i guess) and White is just a Wrapper for this class (to make things more comfortable/easy) ..

I don't see anything wrong with my attempt/posting or question.. If you want i can rephrase my question to:

I am doing some UIAutomation testing with the White Framework but it's kinda slow ... etc. -- which is true... i dont wanna wait for all my test runs to take 1h >_<
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5481
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 12 December 2011 - 06:36 PM

Ok. Didn't mean to ruffle your feathers.

You have to realize that 99% of the people asking about this topic are trying to control on-line poker matches, some game to cheat for high scores, record and play back actions so they can hack into bank accounts or their {cheating} spouce's email and so on.

This post has been edited by tlhIn`toq: 14 December 2011 - 09:00 AM

Was This Post Helpful? 0
  • +
  • -

#5 Tomeki  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 12-December 11

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 12 December 2011 - 06:39 PM

View PosttlhIn`toq, on 12 December 2011 - 06:18 PM, said:

... we don't help newbies ...


So i am a newbie just because it's my first time i have a question, signed up to hope for an answer/tip or any suggestion ... and you dont help people because they have 1 post ?! awesome...so the solution is to spam here around until i hit the counter were people are trying to help me ?!


Sorry but i had to point that out bc. everyone has to start one day with their first post & question :(
Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5481
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 12 December 2011 - 06:48 PM

Guess what... You just lost this supporter.

I recanted my first statement saying "Ok. Didn't mean to ruffle your feathers." And explained the reason we tend to be weary of certain subjects like this one.

But then you had to go and pick out a few words to use out of context - taking a targeted statement on one touchy subject and turn it into a broad generalization with a deep under current of an attitude problem.

I was in the middle of doing some research on this. I like learning new things too. Often questions in areas I'm not personally familiar with are catalysts for learning new things. But I'm done.

I wish you the best of luck getting your project sorted out. There are another 500,000k members here. Hopefully you didn't insult all of them with that cockamamy post and someone will have some suggestions for you.

Happy Holidays.
Was This Post Helpful? 0
  • +
  • -

#7 RexGrammer  Icon User is offline

  • Coding Dynamo
  • member icon

Reputation: 181
  • View blog
  • Posts: 777
  • Joined: 27-October 11

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 13 December 2011 - 02:57 AM

Maybe you should've read the whole post:

Quote

We don't like it when our programs are hacked or pirated so we don't help newbies do it to other people's intellectual property.


And, he is the BEST C# helper out there so you probably lost your best C# learning friend!

As for your problem, maybe you can hit these articles:

Lightweight UI Test Automation with .NET
The Microsoft UI Automation Library

And please don't pull things out of the context, and don't push off someone who is willing to help you for FREE!

And for the record post counters don't mean jack s**t, the rep and the kudo system shows you how much someone has helped the community!

This post has been edited by RexGrammer: 13 December 2011 - 02:58 AM

Was This Post Helpful? 1
  • +
  • -

#8 Tomeki  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 12-December 11

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 13 December 2011 - 07:34 PM

View PostRexGrammer, on 13 December 2011 - 02:57 AM, said:

Maybe you should've read the whole post:

Quote

We don't like it when our programs are hacked or pirated so we don't help newbies do it to other people's intellectual property.


And, he is the BEST C# helper out there so you probably lost your best C# learning friend!

As for your problem, maybe you can hit these articles:

Lightweight UI Test Automation with .NET
The Microsoft UI Automation Library

And please don't pull things out of the context, and don't push off someone who is willing to help you for FREE!

And for the record post counters don't mean jack s**t, the rep and the kudo system shows you how much someone has helped the community!



Hey but it's not my fault that he thinks i am doing some dodgy stuff...and if he does not understand that
i want to automate a process of generating a report and saving this report as file with rather just 1 click in my UI automation *script* rather than clicking 50 times - it is just time consuming and can lead to mistakes if i select a wrong option by mistake....and if you use arguments like the best c# in this forum did - than why bother helping anybody with his problems ?! because almost any piece of code could be used in a *dodgy context* ...

i was stuck and was asking for help or any suggestions/recommendation of other frameworks with what i am working on ...
and you have to start off with 0 rep. and telling someone to "not helping" because he is "a newbie" ...that's ridiculous...
that's why i respond how i did ...

i always found answers in this forums when i searched for solutions to my problems
thats why i signed finally up ... but yeah ... did not make a very good impression to me either ...

however, i dont want to discuss this further because it is pointless and doesn't solve my problem



anyway, i will have a deeper look in the UIAutomation lib which white is using anyway ..
seems there is no other way >__<

Thank you for the links.
Was This Post Helpful? 0
  • +
  • -

#9 RexGrammer  Icon User is offline

  • Coding Dynamo
  • member icon

Reputation: 181
  • View blog
  • Posts: 777
  • Joined: 27-October 11

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 14 December 2011 - 03:38 AM

Well, maybe you should look at the problem at a different way, maybe not look at UI automation but at doing a loop in your code?
Was This Post Helpful? 0
  • +
  • -

#10 Tomeki  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 12-December 11

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 14 December 2011 - 11:32 PM

View PostRexGrammer, on 14 December 2011 - 03:38 AM, said:

Well, maybe you should look at the problem at a different way, maybe not look at UI automation but at doing a loop in your code?


Won't work unfortunately. I try to automate the process of a 3rd party application i am using.
So i have no choice but to use UIautomation to perform the steps.

However, i fixed that problem and topic can be closed.

Solution:
White is a framework for the UIAutomation class, like i said before it was very slow (maybe bc i used it wrong, i dont know).. i gave it a shot and used the UIAutomation class directly instead the white framework.
The speed is a lot faster now and this should fix my problem :-)
Was This Post Helpful? 1
  • +
  • -

#11 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6058
  • View blog
  • Posts: 23,496
  • Joined: 23-August 08

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 15 December 2011 - 04:20 AM

Thanks for coming back and telling us your solution! I marked your topic as solved.
Was This Post Helpful? 0
  • +
  • -

#12 rapsalands  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-June 13

Re: [SOLVED] C# UIAutomation / White Framework - Performance / Help

Posted 17 June 2013 - 03:51 AM

View PostTomeki, on 13 December 2011 - 07:34 PM, said:

View PostRexGrammer, on 13 December 2011 - 02:57 AM, said:

Maybe you should've read the whole post:

Quote

We don't like it when our programs are hacked or pirated so we don't help newbies do it to other people's intellectual property.


And, he is the BEST C# helper out there so you probably lost your best C# learning friend!

As for your problem, maybe you can hit these articles:

Lightweight UI Test Automation with .NET
The Microsoft UI Automation Library

And please don't pull things out of the context, and don't push off someone who is willing to help you for FREE!

And for the record post counters don't mean jack s**t, the rep and the kudo system shows you how much someone has helped the community!



Hey but it's not my fault that he thinks i am doing some dodgy stuff...and if he does not understand that
i want to automate a process of generating a report and saving this report as file with rather just 1 click in my UI automation *script* rather than clicking 50 times - it is just time consuming and can lead to mistakes if i select a wrong option by mistake....and if you use arguments like the best c# in this forum did - than why bother helping anybody with his problems ?! because almost any piece of code could be used in a *dodgy context* ...

i was stuck and was asking for help or any suggestions/recommendation of other frameworks with what i am working on ...
and you have to start off with 0 rep. and telling someone to "not helping" because he is "a newbie" ...that's ridiculous...
that's why i respond how i did ...

i always found answers in this forums when i searched for solutions to my problems
thats why i signed finally up ... but yeah ... did not make a very good impression to me either ...

however, i dont want to discuss this further because it is pointless and doesn't solve my problem



anyway, i will have a deeper look in the UIAutomation lib which white is using anyway ..
seems there is no other way >__<

Thank you for the links.


So generally I don't use this site. But went to this interesting war of words and decided to post something even if the topic is closed. So I created a user here and I am on. Well, for OP, get matured and down the lane and time you should be laughing the way you behaved here. For sure. And others, great to see you still helped him. Many site users revolt this kind of behavior. Nice first experience for me going through all this. It was some learning and more of fun. Thanks. I must see posting some things here and calculate my experience before being a regular visitor here.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1