I have this one object, and in which ever file I use it, the autocomplete window takes suddenly very long (30 seconds) time. Autocomplete for all other objects are being loaded same as before.
Related
So I am using this library ImageMagick off of codeplex to read() in images from a URL. For some reason this function call may hang from 10 to 27 seconds often (every 90 seconds or so). This is too long as I am trying to display fresh camera images to my customers every 10 seconds. I should also mention that I am calling the routine to grab the images from a timer event. This whole subroutine that I am calling from the timer could be squashed and restarted if that helps. However, it is the Read() function that is hanging in this case.
grabImages() ‘Called from a Timer event
Dim MagickImageCamera As MagickImage
‘Read() call hangs occasionally.
MagickImageCamera.Read("http://111.222.111.222/camera111.jpg")
‘Do stuff
End Sub
I should also point out that when the Read() function is locked up I am able to go to the URL of the jpeg in a web browser and refresh the image just fine.
Is the first window guaranteed to be the main window? Or is the order random and inconsistent?
for (String handle : driver.getWindowHandles()) {
driver.switchTo().window(handle);
}
I can't find any information about the order of the window handles, just a way to iterate thorugh them all. I am assuming that the first in the list of window handles is going to be the main window.
According to the current WebDriver API Specification:
6.3 Iterating Over Windows
getWindowHandles
An array containing a window handle for every open
window in this session. This array of returned strings must contain a
handle for every window associated with the browser session and no
others. For each returned window handle the javascript expression
"window.top.closed" (or equivalent) must evaluate to false at the time
the command is being executed.
The ordering of the array elements is not defined, but may be
determined by iterating over each top level browser window and
returning the tabs within that window before iterating over the tabs
of the next top level browser window.
In short, no - there is no guaranteed order.
As alecxe pointed out the handles can be in any order.
I solve the issue of knowing which handle is the main window by saving the handle immediately after I point Selenium to the first page to load (at this point the list of handles contains only one handle, which is the main window), and I save this value for future use. Then when I scan the list of handles later, I compare with the value I saved and know that handles that don't match it are not the initial window.
Doing this is useful in "tear down" or "clean up" code between tests in a test suite if you have some tests that may open other windows. Using the method I describe here, your tear down code can be generic and not worry about whether any specific test is actually opening additional windows.
I have a program where I need to do some initial work before calling the form, so I disabled the Application Framework setting and wrote my own Main function with a call to Application.Run(myForm) when it's time to run the form.
Everything was working fine, no problems, but now I have need of some other service before opening the form. Rather than add all that code to this program, it has all been moved into its own executable. This second program can edit files that the first program will use, so I need the first program to wait so that it will read up those changes (should they be made). I suppose could just as easily use the Shell function, but for various reasons I'm creating my own Process object and calling it/waiting on it through that.
Anyway, I make this call to the second program some time before the Application.Run call. The first program waits its turn, and I can interact with the second program successfully, no trouble at all. But when it's done, the window for the first program is hidden behind any other windows that are on the screen. This doesn't happen in XP, only in Vista (and maybe 7, but I haven't confirmed yet). I've already tried manually forcing the form to appear in front, minimize then maximize, get focus, etc, but nothing brings it to the front unless the user manually clicks on it with the mouse.
What am I doing wrong? Why does this behavior occur? I know it has something to do with waiting for the executable to finish, because if I don't force the first program to wait everything is fine (other than it not waiting). I can circumvent the issue by calling the second program in the Load event of the form, but then I have to read the file a second time to catch the changes instead of reading it once, and it also looks bad because the form is being drawn really slowly while the second program is sitting there.
If anyone has any input, I'd appreciate it.
This isn't really an answer to why you're experiencing this behaviour, but a simple workaround would be to temporarily set the form's TopMost property to True in the load event. Then, depending on how intrusive you want that to be, you could either reset it under a short timer or wait for say the MouseEnter event to fire.
There are another topic in this site about that, but I not got the link. This problem seems be a bug into .NET framework. The API below (VB.NET example) works for me in windows XP and 8.1. Don't tested in other versions of Windows.
<Runtime.InteropServices.DllImport("user32")> _
Public Shared Function SetForegroundWindow(hwnd As IntPtr) As Integer
End Function
Private Sub Form_Load(sender As Object, e As EventArgs) Handles Me.Load
SetForegroundWindow(Handle)
End Sub
In my PyGTK GUI, I am populating a TreeView from a ListStore. The ListStore contains 3 string fields, and this data is read into the store from a plain text file. The TreeView is set in a ScrolledWindow. The list is very long, about 80K lines, which means my ListStore list will be 80K items long. The program takes a long time to populate the TreeView. What techniques are there to avoid reading into memory the whole list in its entirety. How can I read it in steps ? And on what event should I invoke this read-into-ListStore routine ?
There are some tips in the PyGTK FAQ about loading long lists and keeping your UI responsive while loading.
I have designed an app in vb.net 2005 that at one point adds and loops over about 500k list in listbox about.
When adding these items to the listbox, the app freezes for about 5-10 minutes, then when looping over the items, processing them, the app also freezes for the same time. Am loading the data from a text file
How can I make my application
responsive during loops?
should I use a queue to process the
list?
what is the messagequeue control
for?
I recommend you to use BackgroundWorker. Store items in array, and bind listbox to it. Working with array will be much faster then with listbox'es collection.
Or you can call BeginUpdate/EndUpdate before/after adding new items.