Hot answers tagged

6

Yes , I have tested a responsive site into the Different browser. In Google Chrome Browser to test the Responsive view press F12.-> Click on 'Toggle Device Mode' , Using this option we can select the different type of device mode. Another option is we can add app which is "Responsive Web Design Tester", using this on right click menu Responsive Web Design ...


6

Correct Chrome blocks flash by default starting with Chrome 62 see https://support.google.com/chrome/a/answer/7084871?hl=en This worked for me in Chrome 62, its a combination of answers already provided here. ChromeOptions options = new ChromeOptions(); Map<String, Object> prefs = new HashMap<String, Object>(); prefs.put("profile....


5

If you're talking about bringing the browser's window within the OS to the foreground. Selenium cannot do that. You need to introduce a library that is able to automate actions on an OS level. Selenium is restricted by javascript's same origin policy. Looks like you're using Java, so you could take a look at awt.Robot. But be aware that any solution you ...


4

While Selenium can not prevent users from closing the browser, there are other ways you can achieve uninterrupted test execution. Option 1: Use headless chrome With chrome v60+ for windows, you can run chrome headless. This means the browser will not pop up on the screen so users will not be interrupted. It will however, still pop up the chrome icon on ...


4

You should not be running tests on a machine used by user(s). Set up a dedicated computer or VM for testing and and use headless browser mode (more info here and here).


3

It is unclear what do you mean by "Validate". If you are downloading a document and your target is to check its content the question is not related to Selenium as Selenium is browser automation framework. If you use Java client language you can consider i.e. Apache Tika which supports a lot of file extensions and formats to extract data from the downloaded ...


3

Well, I solved it, but it might not be best practice. Basically, in each test method I assign that method to a current thread variable. targetThread = Thread.CurrentThread; and then, when the user presses the stop test button, I kill the thread. It works like a charm. public void haltScript() { targetThread.Abort(); } of course, I'm quitting the ...


3

I was able to determine what was causing the issue. After new session initialization: session = Capybara::Session.new(driver) I was calling following method to maximise the browser window: session.driver.browser.manage.window.maximize Looks like sometimes a new browser window is opening too slow and when Capybara tries to maximise the window, this ...


2

You can put ChromeDriver wherever you like if you specify the path: chromedriver_path = "<path_to_chromedriver>" driver = webdriver.Chrome(executable_path=chromedriver_path) It's really up to you if you want in usr/local/bin or elsewhere.


2

It may be easier to just openAndWait() the URL and do some conditional logic to see if the page displays a maintenance message or not. Incorporating a proxy (as mentioned in other responses) for this one use case sounds like a rather expensive operation. In the past I have setup a proxy to ensure that a tracking pixel (Google Analytics or Omniture, for ...


2

Please use driver.close() and driver.quit() both in the end. driver.close – It closes the the browser window on which the focus is set. driver.quit – It basically calls driver.dispose method which in turn closes all the browser windows and ends the WebDriver session gracefully. Reference


2

This is works for me (in python): from selenium import webdriver options = webdriver.ChromeOptions() options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"]) webdriver_instance = webdriver.Chrome(chrome_options=options) See also: https://stackoverflow.com/questions/24507078/how-to-deal-with-certificates-using-selenium and https://...


2

I have solved the problem by updating my chromedriver to 2.23. If anyone facing such issue then make sure you have updated version of browser and driver.


2

Create a digital signature of a valid file After download get the signature of downloaded file Compare the signatures. If they are the same the download is valid. You can use the MD5 command line tool to create and compare the signatures. The big con is that you need to update the signature if the file changes, possible you need a way to get a dynamic ...


2

A slightly tweaked solution to dimkin's has worked for me: ChromeOptions options = new ChromeOptions(); // Disable extensions and hide infobars options.addArguments("--disable-extensions"); options.addArguments("disable-infobars"); Map<String, Object> prefs = new HashMap<>(); // Enable Flash prefs.put("profile.default_content_setting_values....


2

It's possible to force this status with a Javascript injection via execute_script. To simulate a visible document: Object.defineProperty(document, 'visibilityState', {value: 'visible', writable: true}); Object.defineProperty(document, 'hidden', {value: false, writable: true}); document.dispatchEvent(new Event("visibilitychange")); To simulate an hidden ...


2

My personal approach: Find an identical laptop with the same type of camera and try this again, see it happens. What I would look for: From this laptop's specification sheet, what type of camera is it? What is this camera's firmware version? Can you update it to the latest version? Chrome version, this tester may have a different version of Chrome ...


2

What you show is actually a response body. Headers are represented in "Headers" tab in Dev Tools like this: Brief look up of what you provided shows that it's UTF-16 encoded string: For example: 1 - BATAK LETTER CA 2 - MANDAIC LETTER ATT 3 - http://www.fileformat.info/info/unicode/char/41bc/browsertest.htm no dedicated name


1

You can try to dump page source and parse it, or dump only element source. Page source to pageSource variable (Java): String pageSource = driver.getPageSource(); Element source to elementSource variable (Java): WebElement element = driver.findElement(By.id("id")); String elementSource = element.getAttribute("innerHTML");


1

Some webpages display elements based on viewport size of the browser. I have used CheckMyLinks XPI with chromedriver in a test Automation suite in the past and it provided consistent results. Please ensure you use same viewport size and check for consistency of results or follow the below approach to verify if viewport size impacts number of links on the ...


1

You can add the keyword Choose OK on Next Confirmation or Choose Cancel on Next Confirmation to have the test dismiss the dialog. You would call this keyword right before calling the keyword that causes the dialog to appear.


1

Your question is not really clear, so I have to make a few assumptions here: You are using selenium to automate your tests You know how to access directories on your own PC My suggestion is: Use selenium to click this download button Get the file name that you want to download, say it is "chrome.exe" Access the folder where you save your downloaded files ...


1

As this is tagged with protractor, this is how you allow "unsecure HTTPS" via Protractor config: In case of Firefox: capabilities: { browserName: 'firefox', marionette: true, acceptInsecureCerts: true } In case of Chrome (not tested and may not work as is, https://github.com/angular/protractor/issues/847): capabilities: { browserName: 'chrome'...


1

Certainly there are differences between version but of course it depends on what specific version you compare. As for seeing most traffic under 1 version, this may be a side-effect of most recent versions using the evergreen approach to constantly update to the latest versions. See https://stackoverflow.com/q/14555389/631619 My current Ubuntu Chrome ...


1

I can see that the button is clicked but the responses are not displayed on the UI. Consequently my test is failing when I use chrome browser to run my test. Selenium executes tests much faster in Chrome than Firefox; noticeably faster. So you might have a test that passes in Firefox but fails in Chrome because an element (often NoSuchElementError or ...


1

We have used Capybara with Chrome driver and we had the same issue. When we launch the url, Chrome window was sent to background. To overcome this issue, we have used the following code and it works like magic!! @window = @session.current_window @session.visit url @session.switch_to_window(@window)


1

I used sikuli to detect whether the browser is out of focus since it can see outside the browser window (usually on mac you can see the name of the application on top bar) and then used robot class to do a command+tab. I think you can also use java script executor to pop up an alert so that browser comes to focus before each test suite.


1

As mentioned, Webdriver explicitly decided not to include the ability to inspect HTTP traffic in their project. The recommended technique is to use a proxy to capture the browser traffic by specifying the proxy address in your desired capabilities. Then, you can inspect traffic from the proxy. A common proxy is Browsermob Proxy - it was forked from Selenium ...


1

Update:You can use inbuilt mode in chrome browser for responsive design testing. With help of device mode you can do following: Test your responsive designs by emulating different screen sizes and resolutions, including Retina displays. Evaluate your site's performance using the network emulator, without affecting traffic to other tabs. Visualize and ...


1

Create a desktop background with overlapping boxes at the resolutions you need. Resize the browser windows to match those boxes as needed. Sometimes a lo-fi solution is the best.


Only top voted, non community-wiki answers of a minimum length are eligible