How to clear Editor log and Trace Log when using Automation Instrument - ios

I am using Automation Instrument to test out my iOS app. I was wondering how can I delete my old log messages from the Editor log and Trace Log?
The only way I know is to close my Profile window, open a new one and load in my JavaScript files in again. But there must be a simpler and smarter way to do this.

Unfortunately There is no simple or smarter way to do this yet. You need to restart the instruments IDE to clear the editor log. Alternatively you can wrap your code b/w logstart and logpass/logfail methods as below.
//Begin
UIALogger.logStart("Script start");
/* your test code
.......
*/
//End
UIALogger.logPass() or UIALogger.logFail() or UIALogger.logIssue()
With this you can make editor log grouped under a collapsable anchor and look less clumsy.

Related

How to stop browserlink.js and aspnet-core-browser-refresh

Why do I have all this junk in my console, only when using VS 2022?
I set Options -> Projects and Solutions -> ASP.NET Core -> Auto build and refresh options -> NONE
And also disabled 'browser link' here:
None of that stuff appears when running the same project in VS 2019, and I'm pretty sure its messing with my SignalR connections
For anyone using dotnet cli tool and want to disable the hot reload and console output whatever, and have no luck with dotnet watch --no-hot-reload, try put this at the very start of your js script:
function removeDotnetHotReload() {
const scriptInjectedSentinel = '_dotnet_watch_ws_injected'
// #ts-ignore
window[scriptInjectedSentinel] = true
}
removeDotnetHotReload()
For aspnet-core-browser-refresh, can you please file an issue at https://github.com/dotnet/sdk, as that's where that code lives?
For Browser Link, I can tell you that right now there's no way to disable those messages in a .NET 6 app without turning off CSS Hot Reload as well (you can turn verbose messages off in the console so they won't show, but they'll still be emitted). If you are ok turning off CSS Hot Reload, you can do that in Tools->Options->Projects and Solutions->ASP.NET Core. Please file feedback at Developer Community about this as well so we can potentially make this more discoverable.
That said, I'm curious why you think this might be interfering with your SignalR connections. If there is interference there, we definitely want to address that as well, but I'm not sure off the top of my head why that would be.
Per https://developercommunity.visualstudio.com/t/Browser-Link-cannot-be-disabled/1582653#T-N1608441, adding "hotReloadEnabled": false to your launchSettings.json profile(s) should suppress the injection of these scripts by Visual Studio. This does not actually turn off C# hot reloading - just turns off the scripts that MSFT injects.

How to run FSharp.Plotly (charts) non interactive?

I want to create a console application that makes use of FSharp.Plotly (charts) to show statistics. However, FSharp.Plotly seems only able to run in a .fsx file (documentation didn't mentioned .fs) I tried it in a .fsx file and it was a success, i was able to load a chart.
However, I want to be able to call the graphs (so a pop up appears) with a console application, how to achieve this?
I needed to use: open Fsharp.Plotly (it needs first to be seen in the references list).

Blackberry console output

I am new in black berry development, just like console output in J2me development and log cat in Android to see the event log of the simulator, is there anything for Blackberry so that I can keep a track on application logging on Blackberry.
We can use System.out.println to print something to console.
Also we can use EventLogger to log events to device system log (to view the current event log for the device, go to home screen hold down the ALT key and type "lglg"). Its more fun since we can filter logging by source and priority. Event log file also may be downloaded from device with command:
javaloader.exe -u eventlog > eventlog.txt
See article about javaloader
Also, consider to use some custom logging with microlog lib.
You can use System.out.println() and it will appear in the output window in Eclipse. I would suggest putting some wrapper class around it to emulate some of the features of LogCat, such as making static methods that tag each with [DEBUG], [ERROR], stuff like that. Also, there will be a good bit of other debug output from the simulator/device, so find a way to distinguish your logs (I prepend ========== to each of them so I can see it quickly).

How can I detect a debugger or other tool that might be analysing my software?

A very simple situation. I'm working on an application in Delphi 2007 which is often compiled as 'Release' but still runs under a debugger. And occasionally it will run under SilkTest too, for regression testing. While this is quite fun I want to do something special...
I want to detect if my application is running within a debugger/regression-tester and if that's the case, I want the application to know which tool is used! (Thus, when the application crashes, I could report this information in it's error report.)
Any suggestions, solutions?
You can check the parent process that started your application.
With CreateToolhelp32Snapshot/Process32First/Process32Next get the parent PID (PROCESSENTRY32.th32ParentProcessID or TProcessEntry32.th32ParentProcessID) for your application PID. Then get the filename for the parent PID to compare with the applications you want to check for, like SilkTest.
Check this article for code usage.
In addition to IsDebuggerPresent and CheckRemoteDebuggerPresent, you can also query PEB.BeingDebugged (PEB is Process Environment Block, to get PEB you must query TEB, which is the Thread Enviroment Block).
You're probably looking for the IsDebuggerPresent function.
To detect SilkTest, you could try to attach to a DLL which is used only by SilkTest in order to detect its presence. For example, if the Open Agent is attached to a process, Win32HookDll_x86.dll or Win32HookDll_amd64.dll will be present (the names can be easily found out with a tool like Process Explorer.
You can also do
if DebugHook <> 0 then ...

Delphi: Check whether file is in use

I want to write to/delete a file but sometimes I get a crash if the file is in use by another program. How do I check to see whether the file is opened by another process or I can open it for writing?
The problem is, that between the time you check to see if you could get exclusive access and opening the file, something else gets exclusive access to the file, and you get the exception anyway.
The only fool proof way to see if you can get an exclusive lock on a file is to try and get an exclusive lock on the file, if you get it you have it.
If not, you catch the exception, and either
Go do something else
Wait a while and try again
It's one of life’s situations where it's better to ask for forgiveness than permission :)
There is a new way to get the origin of file locking for Vista and up here:
http://www.remkoweijnen.nl/blog/2011/01/03/cannot-access-files-but-need-the-origin/
UserMode:
The best way to write to a locked file is to ask the user to close it in the other process. In batch processes you should ignore such a file and log the problem. Providing the name of the other process is a very good way to find a solution for the user.
Not sure in which programming language you'd like to check if you can write to a file. In Java, java.io.File.canWrite() can do the job for you.
General:
In UNIX-like OS, you can use the lsof command.
If you want to see which program holds a handle to your file, use the Process Monitor (download from MicroSoft).
This tool has a command line interface, so you could use your language's scripting interface (for example java.lang.Process) to run the tool and display a useful error message.
IsFileInUse as given in http://delphi.about.com/cs/adptips1999/a/bltip0999_3.htm

Resources