Dear all,
I open a website and do some tasks there, then I open a result page in a second tab, and there I have to wait until the result exists.
So my idea was to manually refresh the page every 30 seconds until the result is visible - but when I execute a refresh on the DOM object of the repository, it always refreshes the first tab.
How is it possible to refresh a certain tab, when there are multiple tabs open with the same base URL resp. the same DOM object?
thanks!
How to refresh a certain tab?
Re: How to refresh a certain tab?
I found a somehow solution by changing the path of the toplevel DOM repository item from:
to
This way the refresh is executed on the visible tab only, which is the last one that was used.
It helps in my current use case, but I wonder if there is a better solution possible that maybe works for more than "the actual" tab?
Code: Select all
/dom[@domain='myDomain.com' and @state='complete']
Code: Select all
/dom[@domain='myDomain.com' and @state='complete' and @visible='True']
It helps in my current use case, but I wonder if there is a better solution possible that maybe works for more than "the actual" tab?
Re: How to refresh a certain tab?
Ok, my mistake, setting the
breaks several other stuff in my code, so that's no solution for my case.
Any ideas?
Code: Select all
and visible='True'
Any ideas?
Re: How to refresh a certain tab?
A solution to a similar problem that I had was splitting other page in to a seperate App Folder in the repository. In your case, the path might look like
Then, your refresh action would just be done to this repo item and the rest of your repo items would remain the same. You'll probably want to move the items on your results page under this app folder but I'm not sure it's strictly necessary.
Code: Select all
/dom[@domain='myDomain.com' and @state='complete' and @caption~'Results']
Re: How to refresh a certain tab?
Hi,
My first suggestion would be to use ExecusteScript over a DOM element, as described here:
https://www.ranorex.info/viewtopic.php? ... 51&p=48848
However, because you want to perform refresh over an actually "selected" tab, this would require @visible='True' as you already tried and didn't like
Another solution would be to send F5 shortcut to actually open tab. For example, let's say the tab you are looking for is YouTube, so the xpath you should use looks like this:
/form[@title~'YouTube']//tabpagelist[@accessiblerole='PageTabList']//tabpage[@AccessibleName='YouTube' and @selected='True']
Where @selected='True' assures that only the actually selected tab is returned. So then you can simply use Key Shortcut action to send F5 shortcut to the tab and it will refresh the page.
The above xpath should work both in FF and Chrome, but only if the AccessibleName is filled with proper tab name.
My first suggestion would be to use ExecusteScript over a DOM element, as described here:
https://www.ranorex.info/viewtopic.php? ... 51&p=48848
However, because you want to perform refresh over an actually "selected" tab, this would require @visible='True' as you already tried and didn't like
Another solution would be to send F5 shortcut to actually open tab. For example, let's say the tab you are looking for is YouTube, so the xpath you should use looks like this:
/form[@title~'YouTube']//tabpagelist[@accessiblerole='PageTabList']//tabpage[@AccessibleName='YouTube' and @selected='True']
Where @selected='True' assures that only the actually selected tab is returned. So then you can simply use Key Shortcut action to send F5 shortcut to the tab and it will refresh the page.
The above xpath should work both in FF and Chrome, but only if the AccessibleName is filled with proper tab name.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to refresh a certain tab?
Hi,
thanks for the hint to the title, identifying the correct tab by the page title resp. page url works for me.
I created an additional top-level repo item with variable in RXpath, so each tab is uniquely identifiable and i can then send a refresh to this tab, e.g.
this RXpath:
and this refresh call from UserCode:
Now everything is fine, thanks
thanks for the hint to the title, identifying the correct tab by the page title resp. page url works for me.
I created an additional top-level repo item with variable in RXpath, so each tab is uniquely identifiable and i can then send a refresh to this tab, e.g.
this RXpath:
Code: Select all
MyRepoItem Base: /dom[@domain='mydomain.com' and @pageurl<'someStuff/someOtherStuff/'+$myVar]
Code: Select all
myRepo.Instance.MyRepoItem.Self.ExecuteScript("location.reload(true)");