SOLVED

Entering credentials at a chrome prompt or form using Powershell.

Copper Contributor

HI ,
I'm automating 1 website using Selenium Module in PowerShell, but encountered this issue in the beginning.(see the image below)

Sushmitha5599_0-1659008926076.png

I cannot get the id or class or name of the elements like here (Username, Password, Sign in). How can I enter Username & Password there, and Click on Sign in?

Kindly share your thoughts, It'll help me a lot

 

 

2 Replies

@Sushmitha5599 

 

This is more about Selenium, not PowerShell, since you'd be facing exactly the same issue in another language like C#.

 

Unless there's someone in here that just happens to use Selenium, you might be better off asking in a Selenium-focused community.

 

That said, there's a good article here where they explain how to find the element IDs somewhere between one-third to halfway down the page.

 

Web Automation with Selenium and PowerShell (Step by Step) (adamtheautomator.com)

 

Having a cursory understanding of XPath will also be necessary from the looks of things. Like Selenium, XPath isn't a PowerShell topic, though I'd wager there's a few people here that can help with it, meaning it won't hurt to ask about it.

 

Selenium's support landing page is below. I'd highly recommend checking out the user group and optionally one of the options listed under "chat room" for better Selenium-focused assistance.

 

Support | Selenium

 

Cheers,

Lain

best response confirmed by Sushmitha5599 (Copper Contributor)
Solution
That's basic authentication that happens in the browser, not on the webpage, so you have to pass it like this: https://www.browserstack.com/docs/automate/selenium/basic-http-authentication
1 best response

Accepted Solutions
best response confirmed by Sushmitha5599 (Copper Contributor)
Solution
That's basic authentication that happens in the browser, not on the webpage, so you have to pass it like this: https://www.browserstack.com/docs/automate/selenium/basic-http-authentication

View solution in original post