GWT Selenium Tests sometimes fails - dom

we currently have a nice problem with our selenium tests in a gwt powered gui.
The application contains two sections (filter and grid). Our tests sometimes fails with a NoSuchElementException.
Crazy is the following: I stop the test in eclipse with a breakpoint and inspect the page with firefox firebug or any other addon. And okay - I cannot find the desired element. But (without restarting the application or any other changes in eclipse), if i try again and search the element it is there and a resume in eclipse the test goes green. For me it seems like a synchronize problem in firefox.
A explicitly wait command
new WebDriverWait(getDriver(), 10).until(condition);
has the only effect, that the timeout (10 seconds) happens.
As I said - sometimes the test is green and sometimes it fails.
Has anybody an idea?

Sounds like you load some data asynchronous (RPC) from the server? The data and thus the element which presents the data in the UI is not there yet, when Selenium is looking for it. Depending on how long your queries take on the database or what latency you have on the network the wait time may vary from test-run to test-run.

I have a workaround for this problem and would share this.
The following piece of code is executed before the explicit wait command is running.
Window window = getDriver().manage().window();
Dimension dimension = window.getSize();
Dimension tmp = new Dimension(dimension.getWidth() - 1, dimension.getHeight());
window.setSize(tmp);
window.setSize(dimension);
I figured out, that the DOM is in "synchronized" state after the browser window is resized. So I decrement the width and than set it back to the old value.
If anybody has a better suggestion - let us know ;-)

Related

VSCode exits while debugging a flutter app

It seems like vscode is trying to present data in the Locals and/or Watch for a large object but after about 10 seconds, it will kill the app and give the message "Exited (sigterm)" in the debug console. I can pinpoint it to one example where I break on a line immediately after this line:
Uint8List inputBytes = Uint8List.fromList(List.filled(100000000, 0));
I can see "Locals" spinning around but nothing happens and then the app terminates. Is there a setting that can prevent this somehow? Maybe it can cap the represented data at a certain length instead of trying to print it all out?
(I believe this is a vscode specific problem because when I repeat these steps in Android Studio, it doesn't have this issue)
Thanks.
This is a bug in the debug adapter. It should know this is a list and fetch a paged view of the elements, but it's currently fetching them all. For me it doesn't crash, but it also doesn't respond within several minutes.
I'm working on a fix that will let VS Code page through the data:
This will ship in an upcoming Dart/Flutter SDK release.

Osascript in Yosemite broken/slow - anyone can confirm?

During 10.8 times I created macro in Keyboard Maestro for adding web pages to Reminders list to read them later.
In Mountain Lion and Maverics it worked fine but in Yosemite something wrong is going on resulting very slow executions.
Previously execution time was about 1-2 seconds now its over 40 seconds or even one minute!
Apple team provided me with wrong solution ordered to "code sign" my script, but there is no "file" to codesign and applescripts can be executed in command line. So IMO they messed up something in osascript and still couldn't fix it till 10.10.4. But I need someone to confirm or to advice me how to debug problem, because I cannot find in system console log lines relevant to problem.
UPDATE:
On El Capitan 10.11.1 problem still persist.
Macro
Could anyone test and confirm this? I provided link to macro.
It is bind currently to F1 - change as you like. Before execution create "2Read" list in Reminders on OSX.
I've tried it and it's done in about 1-2 seconds on my machine. So I do not experience the same problem as you.
I'm running OS X 10.10.4 on a late 2013 MBP Retina.
Maybe your "2Read" list is too long?
Another tip:
I used to have a problem with long lists in Applescript, too. Sometimes it would take minutes to run through a list, but after using some if these tips the time for the lists was brought back to only seconds.
From your pastebin link (yeah, I did warn you it'd look like mince):
Keyboard Maestro event logs
(1) KM sends an 'open' event ('aevt/odoc') to Growl, telling it to open a temp file (presumably to make Growl display a message)
(2) Bartender sends a 'get scripting terminology' event ('ascr/gdut') to KM
(3) Bartender sends a 'BTDR/Load' event to KM, which looks like Bt telling KM to load a plugin named "BartenderHelperNinetyOne.bbundle"
(4) KM send a 'KeyC/KeyB' event to something (it doesn't give the name of the process, only its Process Serial Number, which is the classic MacOS equivalent to a Unix process ID). Probably easiest just to ask the KM devs about that one.
(5,6,7) KM then sends three 'application died' events ('aevt/obit') to Keyboard Maestro Engine (I'm guessing that's a faceless helper app that runs constantly in the background), informing it that three osascript processes (PSNs 312312, 315315, 316316) have terminated. This doesn't necessarily mean that osascript has crashed as those events contain an error number ('errn') parameter with value 0, and command-line processes normally return error code 0 to indicate they've completed successfully. It's quite likely these are normal internal notifications sent between KM and KME to indicate when a task is completed. The first of those osascript processes (PSN 312312) is related to the Reminders activity below; the other two I'm guessing are you running other AppleScript macros and probably not relevant here.
Reminders event logs
(1,2,3) The 'osascript' process with PSN 312312 sends Reminders a 'make' ('core/crel') event and two 'set' ('core/setd') events, which is obviously your AppleScript being run.
(4) The Dock sends it a 'reopen' ('aevt/rapp') event, which is probably just you clicking on Reminders' dock icon to bring it to the front.
The main problem, of course, is that without timestamps I can't tell you where your 40-second delay is occurring. You'd really need to do it again, this time manually noting the time at which each message is logged. And if you see a single 40-second delay somewhere in the middle, it should easy enough to determine which events it's occurring inbetween, which should start to point towards a cause. At which point, you're probably best contacting the KM vendor to discuss it with them.
HTH

Zend framework 1 login slow

Generally my application response times are good and pages load quickly. However login, using Zend_Auth with mysql db, takes an age compared to other tasks. I'm wondering has anyone else encountered this?
If not can anyone suggest a good way to debug and find the cause of the slow down?
FYI most pages are rendered under a second after their link is clicked whereas login takes around 7 seconds.
First you need to figure out what is causing slowdown. Add this to your application.ini:
resources.db.setDefaultTableAdapter = 1
resources.db.params.profiler.enabled = true
resources.db.params.profiler.class = Zend_Db_Profiler_Firebug
Then use Firefox+Firebug+FirePHP to see (in Firebug Console) list of all queries. Maybe one of them is really slow? Or maybe you make a lot of them?
Other thing to do is to check Net tab (Firebug) with 'keep changes' turned on to see if you don't make too many redirects or maybe some JS files are slowing down downloading page?
Last step is to install XDebug and run your login with XDEBUG_PROFILE parameter and then use KCacheGrind tool to see what is happening during login and what takes most time.
(Check manual)

Access 2010 Form.Repaint - Hanging

I'm hopefully missing something obvious here...
I have just kicked off developing a new Access 2010 application. Something personal and hopefully simple.
The first thing I need to do is read a bunch of files off of the hard drive. I parse the contents adding the information to a table if it doesn't already exist.
Code works fine, that's not the issue. As it can take a while I've added a simple progress dialog using a standard form but in dialog/popup mode. As the For Each loop of the FSO.Folder.Files object is progressed I send some information to a couple of text boxes and issue a Me.Repaint (have also tried DoCmd.RepaintObject acForm, "FormName").
The issue is that I can get anywhere from 5% to 35% of the process complete before the repaints stop responding. The form only repaints when it gets to 100%.
The process uses limited recursion - if there is a subfolder - it calls itself to process that subfolder, but the folder structure is fairly linear so not many of those.
There are nothing bound to the form. All table updates happen in code and via RecordSets.
Any ideas why Access stops responding?
Cheers,
Roy
Add DoEvents after Repaint. That will cause Access to yield to Windows, which will can then handle its pending tasks ... such as updating the display in this case.
Actually, if your code updates text boxes, I don't see why you need to Repaint the form in order to display the changes. Try something like this instead ...
Me.MyTextBox = "hello"
DoEvents

Why is Eclipse's HTML viewer randomly showing previous output and an error?

Well, this video shows my problem best : http://www.youtube.com/watch?v=yDeChV254Ck&feature=youtu.be
If I have a page that is proper/ok, everything works fine and as expected.
If I purposely induce an error (which I have been doing loads of whilst learning!), Eclipse doesn't show an error at all inline/red underline, and, when I try to run, it will either display an error (which I expect it should be doing every time), or it will randomly display the last successful build.
I can (remotely) understand the logic of alternating, maybe someone would want to see the previous output, but, this is just completely random - no logic at all, so, I just don't understand why it is happening.
Does anyone know what is going on?
edit - been able to recreate this on a brand new install. What is going on!?