Page 1 of 1

How to get the page url before redirecting

Posted: Fri Sep 27, 2019 5:08 am
by quynhnt
Hi All,

I am testing Chrome on desktop (Windows7/Windows10)
I am using Ranorex Studio 8.3

The flow runs as follows

1. Screen 01
2. Click link on Screen 01
3. Open Screen 02 (open new tab)
4. Screen 02 loading with page url is "abc.com"
5. "abc.com" is redirected to "def.com" before the load is completed (The time for redirect is very fast)

I want to get the page url at "abc.com" before redirecting to "def.com"
On ranorex, I used as follows

Action: Get value
Name: PageURL
Repository item: /dom[@domain='abc.com']
-> Error: Fail to find item. No element found for path /dom[@domain='abc.com'] within 30s

It seems that time for redirect is very fast, so it cannot perform get page url at "abc.com"

Please help me

Regard,
quynhnt

Re: How to get the page url before redirecting

Posted: Fri Sep 27, 2019 8:02 am
by odklizec
Hi,

I'm afraid, that without seeing the page in action, it would be very hard to suggest something reliable. What I would personally try, is to add domain 'def.com' to the existing DOM element 'abc.com', like this:
/dom[@domain='abc.com' or @domain='def.com']
This should prevent Ranorex from failing during element search. But I guess it's not what you are looking for? ;)

Re: How to get the page url before redirecting

Posted: Fri Sep 27, 2019 8:44 am
by quynhnt
Hi,

Thank your guide

after updating the DOM
Because the redirect time is very fast
it has get the page URL of the domain 'def.com'

What I look for is how to get the url of the domain 'abc.com'
I don't want to get the URL after redirecting

How to remove redirect?

Regard,

Re: How to get the page url before redirecting

Posted: Fri Sep 27, 2019 8:50 am
by odklizec
Hi,

I believe the redirection is handled by the webpage you are testing? So there is nothing Ranorex can do about this.

Your only hope how to get the URL of page abc.com is from the link, you are clicking on Screen 01. Could you please share a Ranorex snapshot (NOT screenshot) of the screen 01, in which we can analyze the link to screen 02?