1

I am getting the below error when I was trying to approve a document in a webpage

Mixed Content: The page at \'https://example.com\' was loaded over HTTPS, but requested an insecure resource \'http://insecure-page.com:9870/xyz\'. This request has been blocked; the content must be served over HTTPS.'

It is because my test is trying to load a non secure page over a secured page . The page is loaded,but I am not able to proceed further.Could someone help to bypass this error so I can continue with the rest of the steps in my automation testing script . I am using Protractor-cucumber-javascript framework

1

This is actually a security feature of your browser.

If you know that the content from this HTTP url is safe, and if you are using Chrome, you should be able to instruct Chrome to load insecure content by specifying --allow-running-insecure-content command-line option in your config:

capabilities: {
  'browserName': 'chrome',
  'chromeOptions': {
    'args': ['--allow-running-insecure-content']
  }
},

*In general, though, this is not ideal security-wise as all HTTP content would be allowed for loading.

Reference materials:

  • I am able to load the page ,but not able to proceed with the following automated steps – RRR Oct 2 '18 at 15:52
  • @RRR okay, could you be more specific about "not able to proceed with the following automated steps"? Are you getting any errors? Do you have this chrome command-line argument set? – alecxe Oct 2 '18 at 15:56
  • This argument is set in browser config file.Am getting the above error in browser log that I mentioned in the question and not able to click on a button that needed to be done after loading the document – RRR Oct 2 '18 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.