Skip to content

Conversation

@mlipok
Copy link
Contributor

@mlipok mlipok commented Aug 27, 2025

Pull request

Proposed changes

Recently I proposed the already merged : #534
Here I propose to continue this topic.

p.s.
As a next step (PR), I'd like to propose using Au3Stripper to handle line numbers in compile mode.

Checklist

  • I have read and noticed the CODE OF CONDUCT document
  • [ x I have read and noticed the CONTRIBUTING document
  • I have added necessary documentation or screenshots (if appropriate)

Types of changes

Please check x the type of change your PR introduces:

  • Bugfix (change which fixes an issue)
  • Feature (change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (functional, structural)
  • Documentation content changes
  • Other (please describe)

What is the current behavior?

In compiled mode not all testing informotion are outputed to the selected log output.

What is the new behavior?

In compiled mode all testing informotion are outputed to the selected log output.

Influences and relationship to other functionality

None

Additional context

#534

System under test

not releated

@sven-seyfert
Copy link
Contributor

See my commment here. Also relevant for this proposal.

@Danp2
Copy link
Owner

Danp2 commented Aug 30, 2025

__WD_ConsoleWrite is intended to be an internal function, so using it in this manner isn't setting a good example IMO.

@sven-seyfert
Copy link
Contributor

@mlipok, I have to agree with @Danp2.

On a second look I do not understand what do you exactly mean by

In compiled mode all testing information are outputed to the selected log output.

... which "selected log output"? I am a bit confused to be honest. I reviewed the function:

Func __WD_ConsoleWrite($sMsg, $iDebugLevel = Default, $iError = @error, $iExtended = @extended)
	If $iDebugLevel = Default Or $_WD_DEBUG >= $iDebugLevel Then
		If IsFunc($_WD_CONSOLE) Then
			Call($_WD_CONSOLE, $sMsg & $_WD_CONSOLE_Suffix)
		ElseIf $_WD_CONSOLE = Null Then
			; do nothing
		Else
			FileWrite($_WD_CONSOLE, $sMsg & $_WD_CONSOLE_Suffix)
		EndIf
	EndIf
	Return SetError($iError, $iExtended)
EndFunc   ;==>__WD_ConsoleWrite

Are you referring to the $iDebugLevel?
A simple Call(ConsoleWrite, '...' & @CRLF) each time would do the job, am I right 🤔 ?

Best regards to both of you,
Sven

@Danp2
Copy link
Owner

Danp2 commented Aug 30, 2025

@sven-seyfert I understand what @mlipok wants. However, I don't agree with this change for the reason mentioned above. There are probably a couple of different ways this could be handled, but I'm not sure that it is worth the effort.

@mlipok
Copy link
Contributor Author

mlipok commented Sep 3, 2025

@mlipok, I have to agree with @Danp2.

On a second look I do not understand what do you exactly mean by

In compiled mode all testing information are outputed to the selected log output.

... which "selected log output"? I am a bit confused to be honest. I reviewed the function:

This code is related to the output:

au3WebDriver/wd_demo.au3

Lines 112 to 118 in 1834e95

#Region - Output
$iPos += $iSpacing
GUICtrlCreateLabel("ConsoleOut", 15, $iPos + 2)
Local $idOutput = GUICtrlCreateCombo("ConsoleWrite", 75, $iPos, 100, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData($idOutput, "WD_Console.log|_DebugOut|Null", "ConsoleWrite")
If @Compiled Then GUICtrlSetData($idOutput, "_DebugOut") ; set the default value for the compiled version to be able to see the logs
#EndRegion - Output

You can select output for logs.

When you test PC machine if all is fine with WebDriver and with this UDF, for the first test, you choose the simplest possible solution, which should work always and everywhere.
The simplest example of this in my opinion is WD_DEMO.

Therefore, when you use WD_DEMO to test how AutoIt works in this UDF, regardless of whether you test it in the uncompiled or compiled version, you should receive the same messages in the output.

This is my approach after my recent experiences with startup problems (as ADMIN and in an environment with some Antiviruses).

The proposed changes do not alter the way WebDriver is used per se.

They are intended solely to standardize the display of diagnostic messages in both COMPILED and UNCOMPILATED modes.

@sven-seyfert
Copy link
Contributor

Understood, thank you @mlipok.

@Danp2
Copy link
Owner

Danp2 commented Sep 3, 2025

The simplest example of this in my opinion is WD_DEMO.

I think there are some that would disagree with this statement. 😆

They are intended solely to standardize the display of diagnostic messages in both COMPILED and UNCOMPILATED modes.

The output is already consistent IMO. It just doesn't perform the way that you would prefer. 😉

__WD_ConsoleWrite is intended to be an internal function, so using it in this manner isn't setting a good example IMO.

I still stand by this. Have you considered any other alternatives to achieve the desired outcome?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants