browser

Opening Selenium Webdriver tests in the same window

亡梦爱人 提交于 2019-12-24 16:24:25
问题 I have dozens of Selenium Webdriver tests. I want to run them all at once. How do I run the test so that each test does not open a new Webdriver browser window? 回答1: You have to initiate/teardown your webdriver in a @BeforeClass/@AfterClass, and use this webdriver in all your test. public class MyTest { WebDriver driver; @BeforeClass public static void setUpClass() { driver = new RemoteWebDriver(new URL(hubAddress), capability); } @AfterClass public static void setDownClass() { driver.quit();

Is it possible to test if a WebBrowser.Document has been disposed so that I don't keep getting ObjectDisposedException's?

家住魔仙堡 提交于 2019-12-24 16:19:09
问题 Is it possible to test if a WebBrowser.Document has been disposed so that I don't keep getting ObjectDisposedException's? I know the following code will do the job, but I'd prefer to test for the Document being disposed rather than having to catch it. Any thoughts? private Size GetContentSize() { try { if ( this.webBrowser.Document != null && this.webBrowser.Document.Body != null) { return this.webBrowser.Document.Body.ScrollRectangle.Size; } else { return Size.Empty; } } catch

How reliable is Internet Explorers browser mode?

依然范特西╮ 提交于 2019-12-24 16:08:57
问题 I can't seem to find any answers to this: When i change the browser mode in IE, how much can I rely on it actually rendering the webpage as if it were lets say IE8 when I'm using IE10? 回答1: I'm seeing mixed results so far; I never tested the IE9 version, so cannot comment if Microsoft have done better job this time round (the kinds of things reported at https://stackoverflow.com/a/11418046/841830 are much more specific to CSS than I've been looking at). Specifically I've installed IE10 on

Prevent webbrowser from formating html file in c#

孤街浪徒 提交于 2019-12-24 15:56:43
问题 I have some trouble using the webbrowser control in C#, especially when I print it. The thing is, I have a Barcode in my html file and I have to print it (I use a font to create the code). When I open the html file with Firefox or any other Web browser, my barecode is good and I can scan it. But, when I open my file with my webbrowser in c#, or when I print it, the webbrowser ad 2 characters after the barecode. And, when I print the file, my document is not centered, it's like the webbrowser

Javascript: Running time of search through Object?

回眸只為那壹抹淺笑 提交于 2019-12-24 15:54:28
问题 I have a JavaScript Object as: object1 = { "abc" : "def", "ghi" : "jkl" } Now, when I write object1["abc"] . Is this search a linear time search, i.e., O(n) or constant time search, i.e., O(1)? 回答1: Accessing an array/object in Javascript is an O(1) operation. 回答2: Well, I've made a simple program testing this, and it doesn't show constant access time. Most likely there are some other things involved - optimization or memory management or something, but it clearly shows dependence on amount

Back/Forward buttons in Flex applications

不打扰是莪最后的温柔 提交于 2019-12-24 15:45:19
问题 I have a Flex application which uses the BrowserManager class for enabling deep linking within the application. The URLs work fine through all browsers but the back/forward buttons work only with Firefox and Internet Explorer. Even that is a bit flaky and sometimes doesn't work. The buttons don't work in Chrome/Safari or any other browser. Any ideas about how to make this work properly? If anyone has implemented something like this before in a Flex app then would like to hear about things to

How to convert CURL into URI in Elasticsearch

淺唱寂寞╮ 提交于 2019-12-24 15:40:21
问题 I have a curl command for elasticsearch aggregation as below. curl -XGET "http://localhost:9200/employee/_search?search_type=count&pretty" -d '{ "aggregations": { "profile": { "terms": { "field": "_type" }, "aggs": { "hits": { "top_hits": { "size": 1 } } } } } }' I want to search these above curl into my htmlpage in browser, how to convert this into normal url like URI search in elasticsearch ? Please help me to convert above to url ? 回答1: You can use the source query string parameter in

How to tell if Flash AS3 is running in desktop or mobile browser

前提是你 提交于 2019-12-24 15:39:54
问题 I am developing a full-Flash site (Player 10.2). I need to know at runtime if code is running on a desktop/mouse computer or a mobile/touch device, so that I can differentiate the input mechanism. Is this by any means possible? 回答1: How's flash.system.Capabilities.version look? 回答2: Use flash.system.Capabilities.os to check. 回答3: For AIR 3.9: Capabilities.manufacturer returns "Adobe iOS" on ipad2, "Android Linux" on Galaxy s4. Capabilities.version returns "IOS 11,9,900,117" on ipad2 and "AND

ASP.NET Inconsistent PDF file download results

陌路散爱 提交于 2019-12-24 15:30:41
问题 I'm working on a ASP.NET (3.5) website that contains a treeview; the nodes' values are set to a filepath (on the server) of a PDF file. When the user clicks a treenode, the server-side code gets the node value (file path), creates a FileInfo object, and (after setting all the header Content-type, Cache-Control, etc. correctly) calls Response.TransmitFile(xxxxpath) to send to the user's browser. This works fine on the major browsers, on major devices (PCs, Macs, iOS devices). The file

Is it possible to make custom “allow” popup in browsers like chrome & firefox?

喜你入骨 提交于 2019-12-24 15:06:27
问题 I have website that uses Twilio API to make calls. Each time call is made a popup from google chrome comes up saying "http://www.URL.com/ wants to use your microphone. Allow / Deny". On firefox also it comes up in a dialog. Is it possible to apply CSS to it or somehow customize the way Allow/Deny popup shows up? Or maybe show another custom dialog that has custom buttons of Allow/Deny and when Allow is clicked somehow triggers browser Allow button? 回答1: The whole point of these popups is that