Jump to content
Sign in to follow this  
azcn2503

Excessive processor usage, maybe someone can tell me why?

Recommended Posts

azcn2503

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
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
orbs

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
azcn2503

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
water

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
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  

×