Is it possible to disconnect the internet before running a test in AppVeyor build?
I have a test scenario to test an application when there is no internet connection.
Is it possible to disable the internet connection when running the test in Appveyor?
I have tried to add the following Powershell commands. However, it doesn't work. It's stuck in the first command.
- ps: Get-NetAdapter | format-table
- ps: Disable-NetAdapter -Name "Ethernet 4" -Confirm:$false
Note: image: Visual Studio 2019
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 02 Dec, 2020 04:38 AM
Actually, you can perform the tests with VM disconnected from internet. The only trick here you should reboot VM after tests, so build agent could reconnect on boot:
You will be able to print/push test results after reboot.
Hope that helps.
PS: Don't forget to enable adapter before reboot.
2 Posted by weerayuth_r on 04 Dec, 2020 03:45 AM
Thanks Feodor for the suggestion. I will give it a try.