Automate website login process using selenium webdriver

1

Im trying to login to a website using selenium webdriver and excel VBA but im getting stuck at the log in page

im using the following code:

Dim bot As New WebDriver

bot.Start "chrome", "myurl"
bot.Get "/"

'select from drop down
bot.FindElementById("MainContent_ddlRoleType").AsSelect.SelectByValue "7"

bot.FindElementById("MainContent_UserName").SendKeys "userid"
bot.FindElementById("MainContent_Password").SendKeys "password"

'select from drop down
bot.FindElementById("MainContent_ddlAuxCentre").AsSelect.SelectByValue "1"

bot.FindElementById("MainContent_LogOnButton").SendKeys bot.Keys.Enter

all data is entered properly till the log in button is clicked which produces the following error message:

The length of the URL for this request exceeds the configured maxUrlLength value.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The length of the URL for this request exceeds the configured maxUrlLength value.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The length of the URL for this request exceeds the configured maxUrlLength value.]
   System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +11320030
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371
excel
vba
selenium
selenium-webdriver
asked on Stack Overflow Aug 6, 2019 by OB1 • edited Aug 7, 2019 by Pᴇʜ

1 Answer

0

It was a server side error a shortened url lead me to the same page so the problem was fixed. Thanks. –

answered on Stack Overflow May 1, 2020 by OB1

User contributions licensed under CC BY-SA 3.0