The UIATarget.setLocationWithOptions does not seem to be taking effect

My goal is to automate the movement of a user through UI Automation. In an ideal scenario, the user's location in an MKMapView would update based on a predefined list of waypoints outlined in the automation script:

var target = UIATarget.localTarget();

var waypoints = [
    {location: {latitude: 37.33170, longitude: -122.03020}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03022}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03025}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03027}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03030}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03032}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03035}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03037}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03040}, options: {course: 180}}
];

for (var waypointIndex = 0; waypointIndex < waypoints.length; waypointIndex++)
{
    if (waypointIndex == 0)
        target.delay(5);

    var waypoint = waypoints[waypointIndex];
    target.setLocationWithOptions(waypoint.location, waypoint.options);

    target.delay(1);

    if (waypointIndex == (waypoints.length - 1))
        waypointIndex = 0;
}

The location aspect works smoothly, with the user's indicator following the specified path. However, the course option doesn't seem to have any effect. I've experimented with values like 90, 180, -90, 3.14, and

1.57</code, but it doesn't make a difference.</p>

<p>I also attempted adding the <code>speed: 8
parameter to the options, but this didn't lead to any changes.

Considering that this seems to be the only method for simulating headings, and the fact that the course option is officially supported and documented, it's frustrating that it's not functioning as expected.

Potential workaround: If you simulate location using a GPX file on a physical device, the device's rotation functionality kicks in. This allows you to simulate a route and obtain rotation data.

Answer №1

These types of coordinates have been effective for me when using instruments:

{pos:{long:2.105528,lat:41.414359}, params:{vel:20, dir: 290, alt:200, horAcc:10, verAcc:15}}

Experiment with the horizontal and vertical accuracy, and possibly even try adjusting the altitude.

Best of luck!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Display the duplicated values of an array extracted from a JSON object just once

Having some trouble creating a list from json data, you can check out the example. My goal is to display each value only once if duplicates occur (for example, if there are 2 Martini glasses, I only want one to appear in the list), while still preserving t ...

Validate in React whether a key pair exists in the state based on a given parameter

I'm grappling with the challenge of optimizing my application by consolidating multiple dialog window functions into a single function. Currently, I have separate functions for each dialog window that toggle their state: toggleSettingsDialogue = () = ...

What is the reason border property does not transition effectively?

I am trying to remove the border property after a certain period of time (1 second) and make it smooth. Here is what I have attempted: var elem = $('div').css({'border-top':'6px solid #FC9A24', 'border-le ...

Loading identical items using jQuery Ajax

I have a situation where an ajax request is returning multiple URLs which I am using to create images like: <img URL="1" /> <img URL="1" /> <img URL="2" /> <img URL="1" /> <img URL="3" /> <img URL="2" /> and so on... ...

adjusting state with React hooks

I currently have two buttons labeled create signature and Create delivery in my file PageOne.tsx. When the state is set to InDelivery, both buttons are visible. My goal is to hide the Create delivery button initially. However, when a user clicks on the cr ...

Heroku is showing an Error R10 (Boot timeout) message, indicating that the web process was unable to bind to the designated $PORT within one minute of launching

Encountering an error while trying to deploy my first node project on Heroku. Here is the error message: 2020-09-29T04:24:09.365962+00:00 app[web.1]: production 2020-09-29T04:24:09.415266+00:00 app[web.1]: server is listening at port 40890 2020-09-29T04:24 ...

Create a dynamic feature in Bootstrap4 where the navigation bar changes color as the user scrolls to different sections of the

Currently building my personal portfolio website with Bootstrap 4, I came up with a great idea: changing the navigation bar color based on different sections of the website. I attempted to achieve this using JQuery's offset and scrollTop functions, bu ...

Retrieve 25,000 rows of data from Parse and display them in a table view

As a novice in objective-c, I'm struggling to implement a specific feature in my app. I have successfully loaded rows (with 4 columns) from Parse into an array and displayed them in a table view. However, I'm facing issues with loading all 3k row ...

Making changes to a JSON file using JavaScript

Hello everyone, I am a beginner in Javascript and have successfully created a system that allows me to search and filter users in my data.json file. However, I am now looking to develop an application that can add users to the data.json file. Any advice or ...

"Does anyone know of a specific jQuery function that allows for mapping a collection, where the `end`

I have a query that searches for specific elements within a selected area: $(some_selector_here).find("ul li.active a span") I am looking for a function that can loop through this collection of elements and provide access to the complete stack of base el ...

An error is thrown when using AngularJS .length property

Currently, I am carrying out a regular task within my Filter to verify if angular.module('someApp') .filter('filterSomeData',['$filter',function ($filter) { return function (items, keyObj) { var filterObj ...

Adsense displays empty ad banners regardless of their predetermined size

Having trouble with Adsense banners? I have a page with three fixed-size banners (336 x 280) and sometimes they appear blank. It's random - one might work while the others don't, or none may work at all. The code is the same for each banner: < ...

Transferring a value via AJAX that has been modified by a previous AJAX call

In my form, users input values which are used to calculate a result. The calculation is performed through AJAX calls triggered by onchange events on the user-edited fields. This process works as expected. However, there is a hidden field that also gets up ...

A WordPress website featuring the impressive capabilities of the Three.js JavaScript 3D library

I attempted to integrate the Three.js JavaScript 3D library into my WordPress website by including three.min.js in various parts: Within the body of a post <script src="/three.min.js"></script> In the footer <script type='text/ ...

Securing pathways and pages using NextJs

I recently completed a project where I implemented route protection for a website using the if and else statements, assigning each page a function withAuth(). However, I have concerns about whether this is the most effective method for securing routes in n ...

Tips for locating the highest number in JavaScript

I'm having trouble with my code where the first number, even if it's the largest, is not displaying as such. Instead, it shows the second largest number. Even when following suggestions, I encountered an issue where if the numbers are entered as ...

Checking with Protractor to see if the modal is displayed

I am currently working on a Protractor test to check if a bootstrap modal window that confirms the deletion of a record is visible at this time. The record that needs to be deleted is displayed in an angular ng-repeat, so I have to trigger the delete butt ...

Troubleshooting: Issue with jQuery not retrieving the value of input:nth-child(n)

My goal is to dynamically change the price when the model number changes, requiring the id number and quantity to calculate it accurately. Here is the HTML code I have: <div class="col-sm-9 topnav"> <span> ...

Sluggishness in updating properties in a child component using React

Within my main component, I have a button that captures the details of the chosen item and displays them in input fields within a subordinate component. The primary component showcases, <h4 className="table-title">Status</h4> <div classNam ...

The application displays a splash screen briefly before automatically shutting down

Everything was running smoothly on the app until I attempted to link a UIButton to a new view controller. Initially, clicking the button resulted in the app shutting down. However, now when running it on the simulator, the app only displays the splash sc ...