Web driver need to perform the following actions:
Click on a button from iFrame a popup window opens.
Enter the credentials then the popup automatically closes and user is logged in.
Perform some action as logged in user in the iFrame.
I am able to perform first two steps but when I try to perform on the iFrame as logged in user facing the below error:
com.thoughtworks.selenium.SeleniumException: Session [38d070ab-dde8-4b7a-8f19-043ef05dc1cc] has no driver. The browser window may have been closed.
Please mention if there is any work around?
Thanks
You need to switch back to the original window to perform actions there after your pop up is closed.
As Santosh said use driver.switchTo.defaultContent()!
Related
I am using Iron router for meteor and want to create android mobile apps. I create login page that look like WhatsApp application. After user successfully login, i want to make sure that when user click back button,user will never go back to that page. Home page after login is the last page user will view if he keep click back button. So if user click two times back button in the homepage, the application will close.
I hope anyone understand my problem.
My problem is, the first time after user register, the android functionality to kill application after two times back click will not occur.Or can i replicate the two times back button function so if i am in my homepage(after login), and i click button two times, the application will close?
Iron:router has the option {replaceState: true} that you can use.
To accomplish this, all that you need to do is to change your Router.go('home') to Router.go('home', {}, {replaceState: true}) in your redirect hook after login.
With this when your use presses the back button, home will have replaced your login route in the history, and the user will not go to the login page.
EDIT: I just realised that's not exactly what you asked for, but it could help you somehow anyway. I'll try to replicate your case and will edit this post if I find a solution for your issue with exiting the application.
You could accomplish that by setting login page to be displayed only if user is not logged in.
Depends on your app structure you can use {{currentUser}} in html or Meteor.userId() in JS. One solution (the easy way) would be evaluating Meteor.userId() (true if user logged in) on login page route. If it turns out that user is already logged in, it redirects to home page for example.
I want browser to remember the login until the browser is closed. So, if the user opens a new tab, he/she still remains logged in. I tried with the following two options stated in the doc:
https://www.firebase.com/docs/web/guide/login/password.html#section-logging-in
default - It remembers the user even when the browser is closed and reopened.
sessionOnly - It remembers for the current tab only. If the user open the app in a new tab, they are no longer logged in for that tab.
So, you can see we need another intermediary solution where user will still be logged in for the new tabs and that session should be alive until user exit the browser completely. This is the existing behavior that all websites follow for non-remembered login. And for remembered login, they use the default option.
That means, firebase is seriously in need of that intermediary option. My questions are:
Is Firebase going to have that intermediary remember option?
Until this options is implemented, is there a secure workaround?
Thanks.
I have created a web page but i want to restrict only one instance of the page should be running at all times. The scenarios are given as below.
First time - User launches the page by URL and page loads.
User types URL again in another window and it should say that a page is already open OR refresh the existing page.
User closes the window and tries again - new fresh page will be loaded.
Additional Details : I have a database, user authentication.
Tried So Far : Set a flag in DB-->> This method how do i redirect the user back to the page which is already opened.
Any ideas to implement this.?
Thanks in Advance for your opinions and suggestions.
Perhaps you should use a cookie which expires when the user closes the browser. However, all browser instances may need to be closed.
First time, there is no cookie and http_referer does not contain the same domain. (set cookie now)
http_referer contains the same domain
cookie expires and go back to (1)
You should consider using cookies for this. Create a session-long cookie upon opening of the window and destroy it upon closing of the window. If a cookie already exists, you know the window is already open.
This of course relies on javascript and is easily got round. You can not use a server-side solution because it would be impossible to catch the closing of the browser window in order to clear the cookie.
Personally, I wouldn't try and restrict the opening of multiple windows but restrict the functionality available in each window. This approach would be much easier to control using a server-side approach, e.g. events fired in the window can be validated server-side.
Using BlazeDS, I have developed a simple chat room but how do I go about showing who is online and what happen if the user close the web browser without disconnect, will the user name in the online list be remove immediately?
I use mx.messaging.channels.StreamingAMFChannel and set
<subscription-timeout-minutes>3</subscription-timeout-minutes>
There is no way for the server to detect that an user closed the browser, so you need to catch the onbeforeunload event if you want to be able to remove the user as soon as possible (and not relying on a timeout mechanism). In this event send a request to the server and then you can remove the user from the online user list.
There are a lot of example how to catch the event..one is here.
I am developing a simple email portal as my college assignment and I refer gmail for various features.Now when we sign into a gmail account and then if we hit the back button of the browser we somehow still remain on the inbox page.In my case after login if I press back button I comeback to the login page.Please suggest how can I achieve this.Also I am a newbie to ASP.NET so keep it detailed
Very simple. When loading the login page, check the user's current session state, and if they're already logged in, redirect them to their inbox.
The trick is to use javascript's "history.replace(...)" function:
http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript
In essence, you remove previous history entries.