I've an Android phone which needs to be paired with an embedded device (Qt based application on Linux) which we test. I've automated the basic scenarios using ADB commands, to turn on/off BT on the phone, and check the status on the embedded device using Squish. We need to automate scenarios, where the bluetooth/phone goes Out of Range, and check the same on the device. Any idea on how to simulate this programmatically using ADB or even Appium?
Simulate Bluetooth "Out of range" scenarios for test automation
337 views Asked by Sumantha AtThere are 2 answers
Eugen_R
On
Usually test cases like these require a degree of mocking or simulation.
You could simulate your Android phone and fake a lost connection then detect wether the UI displays the expected value on the Qt application side with Squish.
Since it sounds like you work close with the developers team and have means to persuade them, you could fake / mock the communication between the phone and your device under test DUT. In the fake connection you could send a "weak" indicator for signal or cut-off the connection entirely and then check wether the Qt app responds correctly.
In most scenarios it is more easily maintainable and feasible to simulate dependencies. If you need to test on real hardware, then you'd need to invest in the development of a test belch.
You can have a look at this medium article which gives some insight on emulated devices. I bet that you could turn off the WiFi of the emulated device in your test case and thus simulate a disconnect:
https://medium.com/wix-engineering/how-to-execute-android-ui-tests-on-ci-and-stay-alive-eb9089d88c1f
Related Questions in LINUX
- Is there some way to use printf to print a horizontal list of decrementing hex digits in NASM assembly on Linux
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- Writes in io_uring do not advance the file offset
- Why `set -o pipefail` gives different output even though the pipe is not failing
- what really controls the permissions: UID or eUID?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Docker container unable to make HTTPS requests to external API
- Whow to use callback_query_handler in Python 3.10
- Create kea runtime directory at startup in Yocto image
- Problem on CPU scheduling algorithms in OS
- How to copy files into the singularity sandbox?
- Android kernel error: undefined reference to `get_hw_version_platform'
- Is there a need for BPF Linux namespace?
- Error when trying to execute a binary compiled in a Kali Linux machine on an Ubuntu system
- Issue with launching application after updating ElectronJs to version 28.0.0 on Windows and Linux
Related Questions in BLUETOOTH
- React native - how can i listen callBack function
- java android: how to send data on Bluetooth between android and computer
- Pair bluetooth device to Android 12 phone by selecting my own pin
- Bluetooth virtual sniffer for windows
- PyBluez connection problems
- How to set value the descriptor of iOS BLE in Objective-C?
- python script using bluetooth running on windows 11 vs raspberry pi4
- Mobile printing PT200 tru Bluetooth opened in web app
- PlatformException(connect_errd or timeout)
- Bluetooth Driver file corrupt or replaced
- Bluetooth driver Failed and unable to install bluetooth driver for jammy ubuntu
- strange Flutter bug on turning on/off bluetooth permission using IOS device
- Call requires permission which may be rejected by user code should explicitly check to see if permission is available
- Error during getting android Bluetooth device RSSI from Windows 10 using BlueCove library
- Error in Bluetooth specification? Heading field of Location and Speed
Related Questions in APPIUM
- Run automated tests in parallel on desktop and mobile browser
- Run web tests in parallel on mobile and desktop with unique driver
- How to run Parallel tests by groups using Maven and TestNG?
- Selecting an option in the mobile app drop down which is not visible when the app is loaded for the first time
- Unresolved library: AppiumLibrary
- Server connection issue with appium server
- Appium - Unable to take the locators from Appium for Apple Sign-In popup in 16.x OS version
- Appium2, not able to identify android element after scrolling down on the mobile screen
- No keyword with name 'Open Application' found
- Unable to click on element though element is present in iOS
- I can't use appium after installation 'MODULE_NOT_FOUND'
- Appium simulator open in rosetta mode in m1 mac
- Interacting with the Instagram web app in an iOS app can be difficult to automate,
- I am new to Appium. I have written a script but it gives invalid syntax error
- Appium AWS devicefarm
Related Questions in ADB
- How can I build ADB ARM myself?
- Android studio crash, nothing in logcat
- adb screen size changes after reboot
- I want to find fingerprint interface bound by adb
- Connected device (the doctor check crashed)
- Internet wifi video streaming at low speed
- installing 'xiaomi notes.apk' through adb on chromebook getting error
- In Android emulator with sdk 30 or higher, hosts file is reset to default
- react-native android app compile problems
- How to change the "Carrier name" of the Android virtual device (emulator)
- Android Fastboot, infinite bootloop on phone
- adb bugreport get nothing
- ADB doesn't see the device (LD PLayer emulator)
- Understanding virtual to physical memory translation in Android
- How to wait until Android Studio virtual machine is fully loaded
Related Questions in SQUISH
- Runner::call: socket of context -1 is null
- How to close windows in Squish IDE (Python) to automate URL checks
- Squish test for clicking exit/minimize/maximize button for QT application
- Comparing 2 float values in squish
- How to make the QMouseEvent only triggered by MouseButtonPress and to ignore MouseButtonRelease and MouseMove?
- How to use an object in Squish as a pure QT object
- Remote Debugging with Squish IDE
- Window native key inputs in javascript for squish automation tool
- The attachToapplication shows timeout handshake
- Where are Squish tools located?
- Qt QML Type Combobox Item cannot be accessed in Squish
- Simulate Bluetooth "Out of range" scenarios for test automation
- Eclipse (Squish) add custom annotation types
- How do Squish knows that it can execute another line?
- Squish is not recognizing object
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
If you are not using any hardware, like a shield box, bluetooth repeater, moving the phone out of reach, adding a shield material, can you control the bluetooth of the embedded device? Like lower the power, turn it off or control the connection between bluetooth and antenna? Do you need this specific mobile or can you use a simulator with a controlable bluetooth?