Jump to content

How to write login password to open chrome browser instance? selenium, AutoIT


alex1122
 Share

Recommended Posts

I need to write Username and password with my selenium test in popup log , for this I use Auto it script:

Sleep(3000)
Send("DZC\yyyyyyyy") // Username 
Sleep(1000)
Send("{Tab}")
Sleep(1000)
Send("xxxxxx") // Password
Sleep(1000)
Send("{Enter}")

 

It works if I open browser with "hands" go to url and after that I run the script, in this statement it writes Username and password in necessary fields, but it doesn't works if I run my selenium test, so I have automatically opened link in google chrome, after that I run my AutoIT script, but it doesn't works. I think that, with "hands" and automatically opened browsers have differences. So, in my opinion I need to write in my script connection/navigation way to my opened browser login and password fields or something like that. 
As I understand it is impossible to write username and password, because if i open chrome browser and url using my selenium test "chrome is being controlled by automated test software"
I home someone can help me!

Edited by Jos
Link to comment
Share on other sites

1 hour ago, alex1122 said:

I need to write Username and password with my selenium test in popup log , for this I use Auto it script:


Sleep(3000)
Send("DZC\yyyyyyyy") // Username 
Sleep(1000)
Send("{Tab}")
Sleep(1000)
Send("xxxxxxx") // Password
Sleep(1000)
Send("{Enter}")

 

It works if I open browser with "hands" go to url and after that I run the script, in this statement it writes Username and password in necessary fields, but it doesn't works if I run my selenium test, so I have automatically opened link in google chrome, after that I run my AutoIT script, but it doesn't works. I think that, with "hands" and automatically opened browsers have differences. So, in my opinion I need to write in my script connection/navigation way to my opened browser login and password fields or something like that. 
As I understand it is impossible to write username and password, because if i open chrome browser and url using my selenium test "chrome is being controlled by automated test software"

image.png.6380fa4bf6fc8a3123bb7ff4eb1e2aad.png




I home someone can help me!

 

 

Edited by alex1122
Link to comment
Share on other sites

24 minutes ago, Danp2 said:

As written, your script will send the output to the currently active window, which may not be the browser. Suggest that you look at the WinActivate function.

P.S. Also suggest that you change your password now that you've exposed it the the entire world. 😲

Maybe you can write how it approximately looks? 

Link to comment
Share on other sites

  • Moderators

@alex1122 Why would you report your own thread??

 

Also, as stated above, you need to edit your posts and remove the username and password. Not very smart to post that.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

You could probably take a look at using _WD_Alert()

1 minute ago, alex1122 said:

Maybe you can write how it approximately looks? 

Um... this isn't a coding service :D Try it and we're happy to help, otherwise find someone on Upwork or a similar site

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

  • Developers

Not sure if this member is in the right group yet to allow the edit of a post ? (Edited the original post to get rid of the UID & PW) 

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@JLogan3o13 He's too new, no permissions yet 😐

Sorry, ninja-d

Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

  • Developers

Done, but check if you have the Edit in the meantime available as I see your group has changed.

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators
4 minutes ago, Jos said:

Not sure if this member is in the right group yet to allow the edit of a post ? (Edited the original post to get rid of the UID & PW) 

Jos

I changed his membership, not sure why it didn't save. I just did it again and it looks like it went through.

@alex1122 apologies on the confusion, you should now be able to Edit your own posts.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Sleep(3000)
Opt("WinTitleMatchMode",2)
WinActivate("Google Chrome")
Send("Username")
Sleep(1000)
Send("{Tab}")
Sleep(1000)
Send("Password
Sleep(1000)
Send("{Enter}")

I use this construction, it put cursor on Username field, but but nothing else happens, it still doesn't write anything

Link to comment
Share on other sites

Do this and it is MUCH easier - see if you can use a custom crafted URL string to pass your ID and password. I do this all the time in passing data to forms on websites when I'm testing. 

Example: https://www.test.com?id=1234&pw=asdr

Now don't use the example and expect it to work on your issue. You HAVE to get the field ID and put that in the URL string then the text you want to populate in that field. 

Edited by Bert
Link to comment
Share on other sites

57 minutes ago, Bert said:

Do this and it is MUCH easier - see if you can use a custom crafted URL string to pass your ID and password. I do this all the time in passing data to forms on websites when I'm testing. 

Example: https://www.test.com?id=1234&pw=asdr

Now don't use the example and expect it to work on your issue. You HAVE to get the field ID and put that in the URL string then the text you want to populate in that field. 

It is imposible to get field ID, because it is popup log

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...