PDA

View Full Version : Retaining a Web Object's Log In Status


jrak
05-30-2006, 04:42 PM
I'm using AutoPlay to create a CD that will guide a student through a website. The screens will have a web object (with a url from the website) along with audio and written instructions. The website is password protected and the initial screen will have the website's log in page. After I have logged in and move to the next screen (which features a new web object that has a url ending with .aspx), I have to log in again. I've been told that it's not possible to automate the log in process. Is there something else that I can do to retain the log in information when I jump to a new screen?

Tek
05-30-2006, 09:33 PM
Hmm this sounds an awful lot like what I went through here (http://www.indigorose.com/forums/showthread.php?t=15127).

Are you using more than one web object?

Another related thread where I wanted to use authentication can be found here (http://www.indigorose.com/forums/showthread.php?t=15128).

I wasn't entirely sure I understood what you were trying to do. Maybe these threads can help you out. :yes

jrak
05-30-2006, 10:06 PM
Thanks for the links to the threads. The first link was right on point. I had come up with the notion of having multiple web object on a single screen, but as you noted it is very, very messy. Had hoped that another solution might be possible.

I explored the second link as well, but this is not technically feasible because of the way the website is constructed.

Thanks again for you feedback.

johnraus
05-31-2006, 05:45 AM
Yes, automated logon is possible, I do it in several projects:

Sometimes you can add username and pwd to URL like:
http://www.server.com/logon.jsp?username=john&password=secret

or use javascript to fill in username and password and press submit button, in Logon pages in WEB object.

U have to digg in the code to find the name of the fields, and the submit button, when logon page is visible use following URL to fill fields
for Name and Passord;
javascript:void(document.getElementById("Name").value="John");

and for submit:
Javascript:document.formname.submit();

I'm sorry I don't have the time to build a demo apz.

good luck

jrak
06-01-2006, 08:00 PM
Thanks for the guidance regarding automated login. I dug into the code and identified the name of the fields (for name and password). It worked when I pasted the code into the navigation toolbar, but I kept getting syntax error messages when trying to use the code as an action within a script.

I wasn't as successful with the submit button. I identified the name of the form, but when I pasted the code into the navigation toolbar, it did not successfully submit the name and password.

I'm not sure whether I should continue to search for a way to automate the login process of just throw in the towel. Any guidance would be greatly appreciated!

johnraus
06-02-2006, 07:19 AM
Loading the variables is really easy
Here is some AMS code, from my working project

For filling the Name Field, u can use:
VarName="John";
Web.LoadURL("Web", "javascript:void(document.getElementById(\"Name\").value=\""..VarName.."\");");

for submitting the page you have to look for the submit button code, and play around with this code, I'm not an expert, I have to Google myselve to get some working solutions sometimes, but the use of javascript is really cool in combination with the web object.

jrak
06-02-2006, 09:58 AM
Thanks very much for the code. I was able to automate either the name or the password, but not in sequence (I used different variable names for each item.) When both actions were run in sequence, the name field would be empty and the password field would be populated. Did you encounter the same problem?

johnraus
06-02-2006, 06:08 PM
jrak:When both actions were run in sequence, the name field would be empty and the password field would be populated. Did you encounter the same problem?

strange, I filled forms with more than 6 fields with this method and had no problems at all. Maybe someone with more experience with Javascript and stuff could help out ...

jrak
06-05-2006, 10:26 AM
Here are actions that I placed in the Web1 properties "On Loaded" section:

VarName="myname";
VarName2="password";
Web.LoadURL("Web1", "javascript:void(document.getElementById(\"txtUsername\").value=\""..VarName.."\");");
Web.LoadURL("Web1", "javascript:void(document.getElementById(\"txtPassword\").value=\""..VarName2.."\");");