Sign in to follow this  
Followers 0
azcn2503

Excessive processor usage, maybe someone can tell me why?

5 posts in this topic

I'm running the following script to assist with a Selenium QA project:

While true
    WinWait("Authentication Required")
    If WinExists("Authentication Required") Then
        WinActivate("Authentication Required")
        If WinActive("Authentication Required") Then
            Send("username{TAB}")
            Send("password{Enter}")
        EndIf
    EndIf
    Sleep(1000)
WEnd

Can anybody see why this eventually crashes? It slowly creeps up on CPU usage until it maxes out one core and becomes unresponsive.

Share this post


Link to post
Share on other sites



I don't think this piece of code can max out the CPU. There is always a Sleep of 1 second.

Add

AutoItSetOption("TrayIconDebug", 1)

"If enabled shows the current script line in the tray icon tip to help debugging."


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i launched your script. i opened a notepad text and saved it by the name "Authentication Required.txt", so it is detected by your script, which then just writes "username" and "password" to the notepad every 1 second. all as expected.

it's been running for 10 minutes now, no impact over CPU.

i imagine the blame must be on the form you send your keys to.

Edited by orbs

Share this post


Link to post
Share on other sites

Thanks for the responses. Perhaps it is an issue with Firefox. I'll try the debug option and report back if I have some better info.

It could be my machine too, it's getting a little old now ;)

Share this post


Link to post
Share on other sites

But the task manager should clearly show which process eats up all the CPU.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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