Sign in to follow this  
Followers 0
RhysSkachillKelly

Launching a web browser with specific hyperlinks..

7 posts in this topic

Hi all,

I'm new to AutoIT and scripting.. I am attempting to create two scripts. Both will launch in a web browser, one will be firefox, the other internet explorer. Then several hyperinks will launch. I am also attempting to have each of them automatically login with generic credentials although I'm not sure on how to do this as of yet.. Any suggestions on that would be helpful! Below is what I have so far for the internet explorer script but I'm having issues with it. I have attached a screenshot of the errors reported in AutoIT. I can't spot where the syntax error is at all but as I said I'm a total beginner.. Can anyone advise?

Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinWait("Blank Page - Windows Internet Explorer","Favorites Command Ba")
If Not WinActive("Blank Page - Windows Internet Explorer","Favorites Command Ba") Then WinActivate("Blank Page - Windows Internet Explorer","Favorites Command Ba")
WinWaitActive("Blank Page - Windows Internet Explorer","Favorites Command Ba")


#include
_IENavigate($o_object, "http://google.com/")" [ $f_wait = 1])
_IELoadWait ($o_object)
_IENavigate ($oIE, "http://google.co.uk/"[ $f_wait = 1])
_IELoadWait ($oIE)

Thanks in advance!

post-76641-0-66897900-1357319025_thumb.j

Share this post


Link to post
Share on other sites



If there is no $o_object declaration in the first 10 lines of your script then that's the matter.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi all,

I'm new to AutoIT and scripting.. I am attempting to create two scripts. Both will launch in a web browser, one will be firefox, the other internet explorer. Then several hyperinks will launch. I am also attempting to have each of them automatically login with generic credentials although I'm not sure on how to do this as of yet.. Any suggestions on that would be helpful! Below is what I have so far for the internet explorer script but I'm having issues with it. I have attached a screenshot of the errors reported in AutoIT. I can't spot where the syntax error is at all but as I said I'm a total beginner.. Can anyone advise?

Run ("C:\Program Files\Internet Explorer\iexplore.exe")
WinWait("Blank Page - Windows Internet Explorer","Favorites Command Ba")
If Not WinActive("Blank Page - Windows Internet Explorer","Favorites Command Ba") Then WinActivate("Blank Page - Windows Internet Explorer","Favorites Command Ba")
WinWaitActive("Blank Page - Windows Internet Explorer","Favorites Command Ba")


#include
_IENavigate($o_object, "http://google.com/")" [ $f_wait = 1])
_IELoadWait ($o_object)
_IENavigate ($oIE, "http://google.co.uk/"[ $f_wait = 1])
_IELoadWait ($oIE)

Thanks in advance!

Welcome to AutoIt!

I can see from your script that you've been reading the help files included with AutoIt. I have to applaud you for that :)

It looks to me like you're trying to combine COM usage along with the built in UDF's of AutoIt. Run/tweak this in a script session all of it's own, it should help you figure out what you're trying to do... Because you're just using defaults, you don't need to delare them or indicate them.

#include <ie.au3>
$o_object = _IECreate("googlewebsite")
_IELoadWait($o_object)

Feel free to post questions. You're doing good, trust me ;)

EDIT:

Due to the weirdness of this website, I had to take out the google website in my code snippit. Replace googlewebsite with the FQDN for google's homepage.

Edited by Colyn1337
1 person likes this

Share this post


Link to post
Share on other sites

Thanks Thatusernameisalreadytaken and Colyn1337 for your help..

One question I do have is where do get ie.au3 to include?

I've seen this used in a few example scripts but not sure where this is from. Thanks again!

Share this post


Link to post
Share on other sites

Also - Colyn1337 I have tried out your script which works great. Only problem is it seems to open in smaller window every time. Is it possible to specify for IE to open in full screen?

Share this post


Link to post
Share on other sites

RhysSkachillKelly,

I am also attempting to have each of them automatically login with generic credentials although I'm not sure on how to do this as of yet.

Carefull, don't know what "generic" means in this context but you might want to read this.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

the login credentials isn't important, its not for any kind of bypassing security. Its just for logging into a daily checks web page for my team to perform their checks quickly and efficiently. The web page already has generic credentials so rather than entering the credentials in every tab that opens I'd like the credentials to be entered automatically to save the hassle.

Does anyone know if there is a way to specify for the IE window to open in full screen? this would be the final piece to the puzzle :geek:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0