browser

How to open incognito/private window with Selenium WD for different browser types?

≯℡__Kan透↙ 提交于 2020-02-10 05:50:49
问题 I want to test my test cases in private window or incognito window . How to do the same in various browsers: firefox (prefered) chrome (prefered) IE safari opera How to achieve it? 回答1: Chrome: DesiredCapabilities capabilities = DesiredCapabilities.chrome(); ChromeOptions options = new ChromeOptions(); options.addArguments("incognito"); capabilities.setCapability(ChromeOptions.CAPABILITY, options); FireFox: FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference(

How to open incognito/private window with Selenium WD for different browser types?

纵然是瞬间 提交于 2020-02-10 05:50:26
问题 I want to test my test cases in private window or incognito window . How to do the same in various browsers: firefox (prefered) chrome (prefered) IE safari opera How to achieve it? 回答1: Chrome: DesiredCapabilities capabilities = DesiredCapabilities.chrome(); ChromeOptions options = new ChromeOptions(); options.addArguments("incognito"); capabilities.setCapability(ChromeOptions.CAPABILITY, options); FireFox: FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference(

In IE, how can displaying the browser's list of saved usernames/passwords and save username/password dialog be controlled using javascript?

风格不统一 提交于 2020-02-07 05:29:05
问题 In my web-application, there are two pages that deal with the user's account, the user account create/edit page and the login page. These pages do pretty much as expected, except I want to: Prevent the browser's usernames/password list (aka, list) from being displayed on the user account create/edit page, Conditionally display the list on the login page, Conditionally display the browser's save username/password dialog (aka, save-dialog) after submitting the user account create/edit page, and

How does browser detect embedded web content from a HTML page?

安稳与你 提交于 2020-02-05 06:23:45
问题 Once a browser gets the main html page, how does it know which are the embedded content should be request again from web server, and which are only external links? Is it based on type of tags, e.g ? If so, could someone give me a reference of what these tags are? Thanks. 回答1: The HTML5 spec defines the element category "Embedded content": Embedded content is content that imports another resource into the document, or content from another vocabulary that is inserted into the document. It lists

How does browser detect embedded web content from a HTML page?

北城余情 提交于 2020-02-05 06:23:05
问题 Once a browser gets the main html page, how does it know which are the embedded content should be request again from web server, and which are only external links? Is it based on type of tags, e.g ? If so, could someone give me a reference of what these tags are? Thanks. 回答1: The HTML5 spec defines the element category "Embedded content": Embedded content is content that imports another resource into the document, or content from another vocabulary that is inserted into the document. It lists

Can't paste dynamically generated image from any browser to MS Word

纵饮孤独 提交于 2020-02-04 01:31:26
问题 I have an application that generates an image and then pushes this to the browser. The image displays with absolutely no difficulty, and can also be saved by right clicking, and can be pasted without issue into applications such as Gimp but cannot be pasted into MS Word. I fiddled with all aspects of the application to make sure that content-types and all other headers are correct, but this has no effect on being able to paste in the image. 回答1: The solution is a little strange. It is related

PHP - get_browser() results

假装没事ソ 提交于 2020-02-03 10:45:49
问题 I'm using the get_browser() function, and I installed the latest php_browscap.ini file from http://tempdownloads.browserscap.com/, updated my php.ini file to reflect the new location. Here's my simple code I've gleaned from PHP's site: <?php echo $_SERVER['HTTP_USER_AGENT']; echo "<br>"; echo "<br>"; $browser = get_browser(null, true); print_r($browser); ?> And the result is this: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 Array ( [browser_name_regex] => �

What is the common way to say “no javascript” in the request header?

天涯浪子 提交于 2020-02-03 04:47:10
问题 I want to tell the server that the browser does not support javascript. What's the most common approach to do that? (What header is most common?) 回答1: The HTTP protocol doesn't define any such header. So you could use a custom one. Like: X-JAVASCRIPT-ENABLED: false But of course you could have as well used any other header you liked. And by the way may I ask why would the server would care whether the client supports javascript or not? I mean that's the client responsibility. The <noscript>

How does Safari know when to prompt user to save password?

这一生的挚爱 提交于 2020-02-01 04:15:17
问题 This related to How does browser know when to prompt user to save password? except mine is specific to Safari. I have a website in which there are two different ways you can log in. The first is the main site in which you have to enter your email, password, and your account's domain. The second way is to actually go to your domain (which is pointing at my server) at which point you're only asked to enter in your email and password. Logging in the second way (two inputs), Safari, Chrome and

How does Safari know when to prompt user to save password?

时光毁灭记忆、已成空白 提交于 2020-02-01 04:14:54
问题 This related to How does browser know when to prompt user to save password? except mine is specific to Safari. I have a website in which there are two different ways you can log in. The first is the main site in which you have to enter your email, password, and your account's domain. The second way is to actually go to your domain (which is pointing at my server) at which point you're only asked to enter in your email and password. Logging in the second way (two inputs), Safari, Chrome and