Time Out Issue in iFrame - java

I have one Java based web application. This application has login page where I can login into the application and go to other jsp pages. It has session time out set already in the web.xml file (let's say for 10min).
In one of the jsp page, I am showing BI report in iFrame. Now what is happening is, when I am working in BI report under iFrame for more than 10 minutes , I am getting time out message after 10 minutes., because page is not considering iFrame action as it's action, so getting time out message.
Please let me know if you have any idea or solution to ignore time out while working inside iFrame.

well you could add a javascript listener on the i-frame in order to handle the user's action when he is only active inside the i-frame
check this answer or this

Related

Need to check that user Login or not by using Browser Cache | Selenium Java

In my scenario, I've web page without any login panel. (i-e there's no account dashboard, usually other sites have at top right corner with user profile picture/name).
I've an email input field to enter email. And my page checks and shows a login button only if email is already registered in our database.
Then user logged in with his email and password, my page refreshes once with only some DOM changes and get user logged in to our system.
I'm running automation at 2 pages before this, but stucked here at 3rd page. I need to check this by browser cache/cookies because I havn't any other new element appeared at page.
Please help me. Is this possible to do? If not, then is there any other way to check this?
Thanks in advance to the responses.
I am using:
ChromeDriver 77.0.3865.40
Eclipse Version: 2019-06 (4.12.0) with Java
You don't need cookies in this case. Instead, you should property design your test case.
Before starting the browser, cookies should be cleared. Then you start your test, simulate normal login. Then navigate to the needed page. Now you know that the user was logged in and you know what to expect in your test.

How to logout from all open tab once I i logout from one tab in gwt

Gwt is single page application. I have issue. if I am logged-in in different tabs and if I logout from any of one tab. other tab still works. but if I refresh than it does log out.
my understanding is gwt is single page application and it does not refresh the page. it only clear the panel and put new stuff on that same panel. if I refresh the page it goes back to the main page
My question is : How can I check if I am already log out without refreshing the page?
any suggestion adn help would be appreciated
I tried the Window.Location.reload(); but this load the page and I go back to the main page
if I log out than it should logout from all other tabs and go back to the login page
I think it’s normally enough to leave the other tabs as they are, and as soon as the user tries to do something involving a server connection, which will fail once the user is logged out, redirect the user to a login page then.
However, if you want the user to be logged out immediately, you need to make a server call (e.g. GWT-RPC) regularly to check that the user is still logged in. For example, once every 5 seconds. For example, you could schedule such a repeating check using http://www.gwtproject.org/javadoc/latest/com/google/gwt/core/client/Scheduler.html#scheduleFixedDelay-com.google.gwt.core.client.Scheduler.RepeatingCommand-int-

How to avoid calling cometd serversession listener while reloading the page in browser instead of closing the window?

I am working with cometd library for pushing notifications to web page here I am facing one problem i.e., whenever I am reloading (refreshing) the browser page
ServerSession.addListener(new ServerSession.RemoveListener() {.......}
this method is calling unfortunately in some browsers how to avoid calling this listener,actually this listener should call whenever window closes or any click event occurs on link,So please help me to achieve this.Thank you
The reload extension does what you need.
With the reload extension, refreshes of the same page or click on links that move to other pages of the same CometD application will avoid that the client re-handshakes with the server, therefore keeping the original session across reloads or links.
If you want to avoid the calling ServerSession.addListener(new ServerSession.RemoveListener() {.......} while reloading the page in mozilla firefix and opera browsers just comment the $.cometd.disconnect(); and use window.onpagehide instead of window.unload because window.unload will call while refreshing the page in mozilla and opera browsers.It fit for me perfectly.Thank you.

I want to load a browser component and want to fire a URL

I want to load a browser component using swing.
below is my full requirement
I want to create a one desktop application that will load browser component and fire one URL so that user will get one jsp page that is deployed in another server.
I googled and found one code from below link but problem is jsp page is loaded without any CSS or like that we have applied while making jsp page
http://www.java-tips.org/java-se-tips/javax.swing/how-to-create-a-simple-browser-in-swing-3.html
I verified css is applied properly by firing URL in another browser.
I tried using jxbrowser api also but that is giving me licensing error.may be it is paid version(I am not sure)
Any help would be appriciated.
Thanks in advance
you cal load browser eclipse.swt.browser.Browser class
check this url : http://www.java2s.com/Tutorial/Java/0280__SWT/UsingBrowsertoloadawebsite.htm

Spring mvc result page and back browser button

On my MVC spring application I send a form to a page using post method to perform a search with some parameters. The results of the search is a list and, for every entry is possible to navigate to a details page. It works fine but, when an user try to come back to result page with back browser button (or a Javascript), I get an "Expire page" error. Refreshing the page, it rexecutes the post submit and it works fine.
To prevent this error I added
response.setHeader("Cache-Control", "no-cache");
to the search controller and everything works fine with Safari and Firefox but I get the same "Expire page" error when I try to execute the web application with IE (8 and 9).
What's the right way to go to a detail page and come back without getting any error?
thanks for your time!Andrea
The right way is to use GET instead of POST: searching is an idempotent operation which doesn't cause any change on the server, and such operations should be done with a GET.
Not expiring a POST request seems to undermine the very idea of a POST:
Per RFC 2616, the POST method should be used for any context in which a request is non-idempotent: that is, it causes a change in server state each time it is performed, such as submitting a comment to a blog post or voting in an online poll.
Instead, I would restructure how you view the detail records, maybe with an overlay DIV that doesn't refresh the underlying page that shows the results. With many modern web apps, using the BACK button can cause issues with page flow.

Categories

Resources