Playwright's performance in capturing events on chrome pages is not stable enough. Is there a good solution? - playwright

We sent some click events to Google Analytics on the web page. We wanted to use Playwright to test these events automatically but found that these events could not be captured well in the code. I have used some methods, such as 'expect', 'page wait for locator', and some 'wait for time out', but the effect is still not good enough. Is there a better way to help solve this problem?
I want to know what is the cause, just because the program runs too fast?

Related

Re: Julius Speech Recognition

I am using julius speech recognition for my application. I have one doubt regarding julius:
I have downloaded the latest version and was successful in using its lib and making it work. the problem I am facing is..once the app starts and I call the voice recognition function in my application...it takes the input from mic and displays whatever is said in the mic, but the function still continues to do so again and again. The control will never come out of that function. Here I am facing problem since the control is not returning back I am not able to proceed further. What I want is once the engine gets input from mic it should recognize and stop there.. which I tried to do by deleting the callback function but was unsuccessful.
Can anyone please guide me in this matter, what I need to do to get the desired output. It will be helpful for me.
As discussed in the same post on VoxForge:
You have a couple of choices: first to use the Julius -input control to get the sound data from a list of files (see the .jconf sample file), so that when the list (even if only length one) is exhausted then Julius stops. It is quite easy to record the voice input to a file and then feed the file into Julius. Second you can put a dialog manager in control. If you need more information on what a dialog manager does there are many posts on this forum on that subject accessible by a search.
The basic function of Julius is to start up and then keep on decoding input. When you get more experience you can run Julius as a server, and then tell the server to respond, not respond or shut down as required. It's more efficient than having Julius start and stop all the time.
When an avenue exists for a complex application to yield the required result by using an effective combination of options at run time, editing the application, while possible, might involve a lot of unnecessary work. The emphasis then shifts to passing the options correctly in whatever script is being used to access Julius.

Indy Telnet SendString robustness best practice

I have a simple Firemonkey application with a series of buttons and sliders (track bar) that when a user interacts with these controls it send a command using IdTelnet. i.e.
IdTelnet1.SendString(' '+str+#13);
The problem is that very occasionally the users experience total lockup of the app and windows reports the app as "Not responding" when clicking on something. I have not reproduced this myself however I suspect its related to clicking on buttons in quick succession.
My current theory is that I am getting re-entry into SendString and IdTelnet is not handling this well.
Before jumping into writing a queued sending system I wanted to ask for any best practice advice. Is this a known issue and what is the best way to do quick fire sends that are user initiated?

Delphi 7 TWebBrowser - how to exit it

I have developed a Delphi prog which logs into a website, collects "today's number" and displays it on a screen. Having got the data, the only place I could access it was in the final 'download completed' event. This doesn't seem right, as there seems to be no way to get away from the string of 'completed' events. The program never returns from the WB.Navigate call. WB.Stop and WB.Quit seem to refer to browser activity. I want a WB.TERMINATE or something! It's OK for now, but I want to put the web access in a loop, and with the current technique it just burrows deeper into the stack etc. I assume it's running in a separate thread, but can find no info about this. Should I put the browser component on a separate form created at run-time? Would freeing the form tidy things up? Any advice would be appreciated.
EDIT: Thanks for early responses. I must have had a senior moment. In fact the WB.Navigate call does return. The IDE tells me that it launched a thread with the web navigation request. So it's down to me to do some internal synchronizing to check the data arrival. Yes, the data is on the web page not a download. There is no API. I could have done basic searching of the web pages but it's 3 levels deep. The component made it easier to select the wanted data. All good now. Sorry for wasting your time.

Rails4 : live or faye or polling - Reload page when background job is finished

I have a background job (Sidekiq) that generate a pdf and save it on S3 with paperclip.
During the process, I present a "waiting page" to the user.
I'm wondering how to auto-reload the waiting page with the pdf once the background job is completed.
I know how to present the pdf inline when it exists (when background job is finished).
I know how to check if it exist on page load, but I need the auto check its presence till success.
I did my homework and checked what are the possible solutions :
Polling - seems to be an outdated solution, not the most efficient one
ActiveRecord::Live::SSE - Seems to be interesting but complex to my new knowledge on "livestreaming". And not compatible with IE (even it's not a blocker, It is still a con)
Faye and websocket - Still, I have difficulties to understand how to implement it regarding my need.
Could you please help me on what is the best technique, and the proper way to implement it? (mostly the timeout part on poll, and the reload part for live::sse and faye). Most examples show chat apps, which make me wonder if I'm on the right track.

Is there in dart language any method similar to DoEvents() in Visual Basic?

Here is a simple question.
suppose that I have a very long loop to execute, It would be nice to keep the user informed about the progressing right? I would print for example the number of loops that have been executed so far and how many are remaining.
The problem that I have is those output wouldn't be visualized until the the loop is finished, and thus there will be no point for them to be displayed.
I'm sure that there is some method in dart that can some sort of a handler to the browser to execute tasks and events whenever I want to and keep running the loop.
I'm new to dart, I hope that someone could answer this question.
Thank you.
PS: If you don't know how to, you can give me any ideas of keywords that I can use to look for this particular feature in dart documentation, it will be very helpful.
You can dig into Isolates, which allow background work on supported browsers.
https://api.dartlang.org/docs/channels/stable/latest/dart_isolate.html
Nothing as simple as DoEvents(), but all of the pieces are there.
I think too that Isolates are the best approach but wasn't successful using them on the browser a while ago, but there was a bigger refactoring going on lately in Isolates.
Does anyone know of a current client side Isolates example?
The API doc referenced by #kevmoo contains a link to an Isolates article that doesn't exist anymore (maybe must be rewritten due to the mentioned refactoring).
Another approach would be a method that returns after a chunk of work and gets recalled repeated in a loop until it returns for example true for done (false for not yet).
When you call this method using scheduleMicrotask(doChunk) or new Timer(() => doChunk()) other tasks get some air (import 'dart:async';) each time before the method gets actually called.

Resources