I created a progress listener on xhr.upload and tried to display progress using evt.loaded/evt.total. This gives very different results on different browsers and even varies between versions of firefox.
On chrome (Version 34.0.1847.116 m) evt.loaded starts from 0 goes up to total and does this twice(goes back to zero).
On Firefox (24.4.0) evt.loaded goes from 0 to 2x evt.total (evt.loaded>evt.total)! gives 200%
On Firefox (24.2.0) evt.loaded goes from 0 to 2x evt.total sometimes but mostly behaves normally and varies from 0 to evt.total (different behavior on the same browser)!
The files I'm uploading are zip files between 8 to 100 mb.
I find this completely unusable, is there a workaround that would suit all cases? Also what is the cause of this behavior. Finally is this the intended use of evt.loaded and evt.total?
Related
As mentioned in the title, the following issue occurs since chrome was updated to v78. Before chrome v78 all tests worked just fine.
The behavior is highly nondeterministic, so please bear with me.
Meaning sometimes it just works out of a sudden, without any changes. Most of the clicks in the tests are working. Just some fail repeatedly (most of the time).
We are using selenium with the latest driver for chrome 78. The problem appeared first on driver version 77 with chrome 78 running.
Not the spec-flow tests nor the adapter-code has changed in any way, but after the Chrome update basically all tests failed.
Doing a Thread.Wait(1000) before EVERY CLICK seems to be the most reliable way to avoid the problem, and clicks the element as requested.
When im not waiting, the driver runs through the "Click", including the steps listed below, without actually clicking or throwing any error.
lookup of the element:
new WebDriverWait(this.webDriver, this.WaitTimeout).Until<IWebElement>(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(by))
waiting for the element to be clickable:
wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(by));
scrolling towards the element:
((IJavaScriptExecutor) this.webDriver).ExecuteScript("window.scrollTo(0, " + (object) (e.Location.Y - 250) + ")");
and performing a click and release action on the element:
action.Click(element).Perform()
i have also tried several other variants of mouse clicks including the one from the comment.
Since the process just works through all this, without actually throwing an error or warning of any kind, i have no way of checking if the click actually happened (other than checking the current URL, which would be a nightmare to maintain in the tests).
So the website is not updating and remains on the source page and the test will fail because the next test doesn't run on the expected page.
now the question:
Is there anything i can query for or wait for to see whether the driver or chrome can actually click that element (really) or to verify that it was actually clicked?
original issue report:
https://github.com/jsakamoto/nupkg-selenium-webdriver-chromedriver/issues/66
Apologies for the slightly vague question but I'm pulling my hair out. Since this update we have had numerous calls regarding printing from our web app. Our web app uses an iframe and we use css #media print to hide all but this iframe for printing purposes. Since the update the user receives an Error 404--Not Found instead of the actual page. It would seem from the network trace that IE creates a temp .htm file in the local directory like D3CD911.htm, it then downloads css/js resources and then finally it makes this call /D3CD911.htm. This is making a call to www.mywebsite.co.uk/D3CD911.htm. This obviously does not exist on the website so the 404 is returned.
I struggling to find a pattern to the problem and it doesn't seem to be affecting other public sites. I think the issue is with window.print() method. I can semi reproduce it here at https://www.primefaces.org/showcase/ui/misc/printer.xhtml. If you click the print button you will get the error. Although this is using the jqprint javascript function if you then use the browser print button it also fails.
Any guidance would be much appreciated.
andyfinch, you're a genius! The following code appears to work for a print button contained within a frame:
function Print() {
if (document.queryCommandSupported('print')) {
document.execCommand('print', false, null);
}
else {
window.parent.<framename>.focus();
window.print();
}
}
Update:
Microsoft have now released a patch: Microsoft IE patch
Just wanted to summarise the workarounds I've found and which have been posted here.
1) If you are using your own print button change to use document.execCommand('print', false, null);. Test support using document.queryCommandSupported('print') and call window.print() if not supported (Prob just Firefox)
2) Use Print Preview. Additionally select the part of the page to print, right click and select print preview. Then select As selected on screen.
3) Use another browser like Chrome
4) Uninstall the update
5) Wait for Microsoft fix. Their KB page KB Link has been updated with this as a known issue. Therefore you assume a fix is on the way.
andyfinch's workaround is also working for us. Thanks Andy!
MS has flagged this issue with "WON'T FIX" (6/15/17): https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12349663/ Update: that flag might just indicate that it's not an issue with MS Edge so it won't get fixed by the Edge developers.
Installing KB4021558 breaks printing from our website (the pages are blank, the footer shows some variant of "res://ieframe.dll/i273gyew.htm"). Uninstalling it restores printing functionality.
KB4021558 is also included in KB4022719, KB4022725 and KB4022727.
I found a workaround: if the iframe you're trying to print is visible, right click on it and choose Print preview... instead of Print... from the context menu. The preview seems to be printable (but may show only part of the frame contents).
Also, for the record, the problematic 64-bit Win7 update is KB4022719.
MS released updates yesterday (June 27th) that address it for Windows 10:
This non-security update includes quality improvements. No new
operating system features are being introduced in this update. Key
changes include:
• Addressed an issue introduced by KB4022715 where Internet Explorer
and Microsoft Edge printing from a frame may result in 404 not found
or blank page printed.
Links:
Windows 10 (Initial Release - Build 10240)
KB4032695 - Build 10240.17446
Windows 10 Version 1511 (Initial Release - Build 10586)
KB4032693- Build 10586.965
Windows 10 Version 1607 (Initial Release - Build 14393)
KB4022723 - Build 14393.1378
Windows 10 Version 1703 (Initial Release - Build 15063)
KB4022716 - Build 15063.447
Source/More info
I grabbed them from the Windows Update Catalog today, to use with WSUS.
Heres the workaround I have been using for this in IE 11:
Right click frame and choose select all, or [ctrl + A] in the frame
Right click and choose print preview
There should be an option in your preview for "As selected on screen". Choosing this allowed me to print everything in the frame.
We were having multiple frames in the print screen and calling document.execCommand('print', false, null); could not fix our issue. Instead window.parent[frameName].document.execCommand('print', false, null); fixed it.
I am creating a Windows Phone app (XAML/C#) that uploads audio and video to a server. Using VideoCaptureDevice on Windows Phone 8.0 works fine, but it only allows resolutions supported by the device (on a Nokia 625 the smallest is 640 x 480). To get the size down I have upgraded the app to Windows Phone 8.1 Silverlight (Developer Preview) to use the Windows.Media.Capture.MediaCapture libraries. This works and the generic Qvga format:
MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(Windows.Media.MediaProperties.VideoEncodingQuality.Qvga);
Works on both the Nokia 625 and 520 and gets the resolution down to 320 x 240, but the file size is still ~24MB for 4 minutes of video. If I set a custom resolution like this:
MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(Windows.Media.MediaProperties.VideoEncodingQuality.Auto);
profile.Video.Width = 480;
profile.Video.Height = 320;
I get a much smaller file size (4 min == ~6MB, which is odd) but it is corrupted on the 625.
I would like to try it out with other file types, eg .wmv, but:
MediaEncodingProfile profile = MediaEncodingProfile.CreateWmv(Windows.Media.MediaProperties.VideoEncodingQuality.Auto);
Gives a System.Exception "No suitable transform was found to encode or decode the content."
I'm also going to need to do this for audio, ie:
MediaEncodingProfile profile = MediaEncodingProfile.CreateMp3(Windows.Media.MediaProperties.AudioEncodingQuality.Auto);
But I get the same error.
I suppose I'm asking lots of questions here, but I'm really asking:
What's the best way to reduce video size in Windows Phone 8.1 Silverlight?
Can anyone help me apply a suitable transform for .wmv and/or .mp3 recording?
Does anyone know why setting the video resolution manually causes instability?
I have also tried setting the audio properties manually to see if that will get the size down:
MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(Windows.Media.MediaProperties.VideoEncodingQuality.Qvga);
profile.Audio.Subtype = "PCM";
profile.Audio.ChannelCount = 2;
profile.Audio.BitsPerSample = 8;
profile.Audio.SampleRate = 22050;
But this also leads to a corrupted file.
Any help greatly appreciated - have hunted around but found very little on the subject...
Maybe it is related to this IoT:
https://ms-iot.github.io/content/en-US/win10/ReleaseNotesRTM.htm
Release Notes for Windows 10 IoT Core Build Number 10586. December 2015
Known Issues
A MediaEncodingProfile.CreateWma( Windows.Media.MediaProperties. AudioEncodingQuality.Auto) method call may fail on the Raspberry Pi 2 with the error message No suitable transform was found to encode or decode the content. (Exception from HRESULT: 0xC00D5212). (4510128) WORKAROUND: None.
I have a fairly large set of Selenium tests (about 180), which have worked very well over a long period on XP and Win7 32/64bit machines.
Recently, after a Windows 7 update (which may be coincidental), the tests have become unreliable. They fail at random, but always with the same problem - an expected screen is displayed but the WaitForPageToLoad() method does not return to confirm this. This does not occur on the XP machines, only the recently updated Win7 machines.
Platform: Win7, 32 and 64bit, Selenium 1.0 and 2.33.0 (no difference in behaviour), VS2008, browser IE9.
Scenario: A test initially displays a 'restart' screen with a single button, clicks on the button which should launch a login screen (all the tests go through the same code to do this). The login screen is displayed in the browser but the test line
selenium.WaitForScreenToDisplay(30000);
does not return so the test times out with an error message. The tests will fail in this way completely at random - about half of them fail, but not consistently the same ones.
The application itself behaves perfectly when a human being interacts with the browser. The selenium logs don't give much in the way of clues - the last line is always 'waiting for page', eg "....Command request: waitForPageToLoad[30000,... ]".
Stepping through the test in the VS debugger never reproduces the problem.
The actual code where the problem manifests itself is
selenium.Open(GetRestartPageURL());
selenium.WaitForPageToLoad("30000");
selenium.Click("Button");
selenium.WaitForPageToLoad("30000"); <-- this is where it times out even though the expected screen that is launched by "Button" is now displayed in the browser
Is there a known problem, or a workaround for this? Is it an issue with IE9 and Selenium 1.0? Its come out of the blue at a critical time.
This turned out to be a bug in IE9/10 and/or selenium, or at least a bug in IE9/10 that the selenium folks do not look like addressing any time soon. I worked around it by writing my own WaitForPage method that looks at window.document.readyState in the browser and also monitors the delay so I still have a timeout.
Here's the code, if it will help anyone else:
internal static void WaitForPageToLoad(ISelenium selenium)
{
//Wait until the browser reports that it is no longer loading the page, or 'timeOut' has been reached.
//Pause 1/4 second between attempts (should normally be sufficient for the page to load, unless it is a very slow page)
const int timeOut = 30000; //mS
const int pause = 250; //mS
int timeWaited = 0;
do
{
System.Threading.Thread.Sleep(pause);
timeWaited += pause;
}
while (selenium.GetEval("window.document.readyState") != "complete" && timeWaited<timeOut);
if (timeWaited >= timeOut)
{
//abort test and notify error:
Assert.Fail("Expected page was not dislpayed");
}
}
There are two issues in the Selenium bug tracker referencing this bug: 1639 and 2451
Anyway, I am developing a very large scale JSFL system. It's over 2,000 lines of code (Uncompressed).
In my application I have a line of code looks like that:
fl.componentsPanel.addItemToDocument({x:pos.left, y:pos.top}, 'User Interface', type);
You can figure out that this line is creating dynamically components and injecting them in a specified position on the stage.
When I create 4-5 components (using a for loop), this line makes my flash CS5.5/CS5 IDE almost crash. My flash gets stuck for a minute almost, but to be fair it's only when i am running my code on a AS3 document only.
I present a time measurement of the execution time:
4 components in AS2 document: 0.49 Seconds
4 components in AS3 document: 61.422 Seconds
Note: When i execute all the 2,000+ lines of code but that exact line i put in comment the JSFL execution time is less than 1 second in AS2 and AS3 versions of the document.
Does anyone have an idea why this line of code has such an evil behavior?