IT researcher
IT researcher

Reputation: 3304

How to access entered username using selenium in Chrome

I am automating website filling in Chrome browser using Selenium.

For the first time user will enter username, date of birth manually. Now my requirement is when user opens my application for next time I want to enter the name and D.O.B using code.

Previously I was using Internet Explorer and there I had beforenavigate event which will inform me that user is going navigating to other URL. So I used to read the required fields and save it in my database.

How to do this in Selenium or Chrome driver ?

WebElement.getAttribute('value') can be used to get the value, but how to know that user has entered the values to that field ?

Please help me.

Upvotes: 0

Views: 613

Answers (1)

RemcoW
RemcoW

Reputation: 4326

You are trying to fill in a login form for users using Selenium. This is impossible. For this I'd recommend cookies. How to do this depends on the language the website is written in. I'd suggest you do some research on how to do this in your applicaton. If you have questions about this you can make a new post here explaining the details of your application and the issue you are facing.

The reason this does not work in Selenium is that you will need to start a Webdriver to use this. When a user navigates to your website it (most likely) won't be doing this using a Webdriver. Especially not one you can access and send commands to.

Upvotes: 1

Related Questions