-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No working workaround for : Native Automation requires https protocol #8330
Comments
We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news. |
Any updates here? We cannot update chrome because of this issue.. |
Hello @wombatka , We are researching the issue. We will update this thread once we have news. |
Hello, I researched the issue further, and here is what I found. For some reason, the HTTP request event fails to arrive quickly enough to execute the customHook onRequest method. To address this, I introduced a delay before changing the protocol, and everything now works as expected. You can verify the origin of the page in the DevTools console by checking either window.location.origin or window.location.protocol. This is the updated workaround for your case:
Please try this solution and let us know your results. |
Hi. I checked - introducing a delay of minimum 1s works for me. however delay on each request makes the whole test run ( we have over 1500 tests) significanlty slower |
Additionally download files does not work over http- chrome shows insecure download warning and there is no way to switch it off (previously working flags were removed) |
Hello, could you please share an example of this behavior so we can reproduce it on our side? |
Hello, I have found a flag that seems to cause the issue. Try to run your tests with the following command: testcafe "chrome --disable-features=HttpsUpgrades" test.js With this feature disabled, you do not need the custom hook workaround. Please try running your test with this flag and let us know your results. |
Hi. This flag works without a custom hook for me , thank's! |
Unfortunatelly i cannot share a link to our test installation as it is our internal network. I am not sure whether you can find an example domain to reproduce it- this issue occurs when you click some action that downloads a file from a http domain other than localhost on chrome 130. |
What is your Scenario?
I cannot run my tests over http using native automation and chrome 130,
I tried using workaround from: #8133
The url seems to be loaded via http but it is not which can be seen in the browser console
What is the Current behavior?
automatic redirect to https occurs and page is not loaded
What is the Expected behavior?
page should be loaded via http
What is the public URL of the test page? (attach your complete example)
example.js:
import {Selector, t} from "testcafe";
fixture('MWE')
test('Website served only by HTTP is tried to be opened with HTTPS', async () => {
await t.navigateTo('http://www.testingmcafeesites.com/')
await t.debug()
})
What is your TestCafe test code?
example.js:
import {Selector, t} from "testcafe";
fixture('MWE')
test('Website served only by HTTP is tried to be opened with HTTPS', async () => {
await t.navigateTo('http://www.testingmcafeesites.com/')
await t.debug()
})
package.json
{
"name": "testcafeexample",
"version": "1.0.0",
"description": "",
"main": "example.js",
"scripts": {
"test": "testcafe chrome example.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"testcafe": "3.7.0-rc.2"
}
}
customRequestHook.js
const RequestHook = require('testcafe').RequestHook
class CustomRequestHook extends RequestHook {
constructor (requestFilterRules) {
super(requestFilterRules);
}
.testcaferc.cjs
let CustomRequestHook = require('./customRequestHook.js').CustomRequestHook
const hook = new CustomRequestHook(/https?://.*/);
module.exports = {
hooks: {
request: hook
},
skipJsErrors : true
}
}
module.exports = {
CustomRequestHook
}
Your complete configuration file
let CustomRequestHook = require('./customRequestHook.js').CustomRequestHook
const hook = new CustomRequestHook(/https?://.*/);
module.exports = {
hooks: {
request: hook
},
skipJsErrors : true
}
Your complete test report
No response
Screenshots
Steps to Reproduce
1.run test
2.open browser console
3.you will see that requet was sent with https not http
TestCafe version
3.7.0-rc.2
Node.js version
21.7.1
Command-line arguments
npm test
Browser name(s) and version(s)
chrome 130
Platform(s) and version(s)
Ubuntu 22.04.2 LTS
Other
No response
The text was updated successfully, but these errors were encountered: