Strange behavior when changing URL in Safari

Get help with testing, discuss unit testing strategies etc.

Post Reply
User avatar
Premium Member
Premium Member
Posts: 6
Joined: Thu Nov 01, 2018 8:22 pm

Strange behavior when changing URL in Safari

Post by bjones »

I am experiencing some strange behavior when changing URLs in Safari. In our app, clicking on our main logo image re-directs to the main applet by changing the url ( window.location.href = '#'). When automating this with Siesta in Safari, clicking the logo leads to the iframe containing the app to re-direct to the Siesta browser interface instead of the main page. We are using Siesta 5.2.3.

I wrote a workaround to detect the browser we're using and to replace logo clicks with another url re-direct if we're in Safari. This works for now but it would be nice if clicking the logo in Safari did not produce this behavior.

I have included a gif and a reproducible example to produce the issue.

In Chrome - as expected

In Safari


Code: Select all

const project = new Siesta.Project.Browser.ExtJS();

    title               : 'Test',

    group   : 'Classic Tests',
    items   : [{
		desc	: 'Test url redirect',
		pageUrl : '/siesta/spike.html',
		url	: 'classic-tests/system/new-survey/02_spike.js'


Code: Select all

<!DOCTYPE html>
            <span id="clickme" onclick="changeURL()">Click me</span>
            function changeURL() {
                window.location.href = '#';
Test Case

Code: Select all

StartTest(t => {
    t.describe('Test clicking and re-directing to #', t => {
            waitFor : 2000
            click : '#clickme'

User avatar
Core Developer
Core Developer
Posts: 3459
Joined: Mon May 16, 2011 10:48 am

Re: Strange behavior when changing URL in Safari

Post by nickolay »

Thank you for the report, confirmed. This strange redirect only happens when the event handler is activated with the synthetic event. If you click the element manually, the same code is executed, but the result is different. Such browser's quirks are beyond Siesta control, we can not fix it, unfortunately.

I noticed you are assigning to the `window.location.href` which is meant for a full page url, shouldn't it be `window.location.hash`? The latter does not trigger this strange redirect.
We offer training in both Ext JS and our products, read more here.
Read the API documentation

Post Reply