Jump to content

username & password not filling


MRAJ
 Share

Recommended Posts

Hello,

I am using edge browser to run one of my SAP BO Application using WD UDF function, when it opens the browser, log on page will come and i am trying to fill the username & password and click on log on submit using the attached script, but it is not working. not sure why it is not filling the username & password.

#include "wd_core.au3"
#include "wd_helper.au3"

$_WD_DEBUG = $_WD_DEBUG_None ; Could also use $_WD_DEBUG_Error
Local $sDesiredCapabilities, $sSession, $sElement

SetupEdge()
_WD_Startup()
Sleep(2000)
_WD_ConsoleVisible()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession,$URL)

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@id='userName']")

;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@class='logon_table']")
;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='text']")
;I tried with other find element but none are working
_WD_ElementAction($sSession,$sElement,'click')


Sleep(2000)

$sUsername = _WD_GetElementByName($sSession,"username")
_WD_SetElementValue($sSession,$sUsername,"abcd")

$sPassword = _WD_GetElementByName($sSession,"password")
_WD_SetElementValue($sSession,$sPassword,"abcde")

Sleep(2000)
$sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit']")

_WD_ElementAction($sSession,$sButton,'click')

image.png.d27af692c06639333bd36accd4831ac8.png

Link to comment
Share on other sites

Below is the output, i am seeing many times it is giving output as Element not found:

==========================================================================

 

 


 

Edited by MRAJ
Codebox or a fileattachment would be better to share this.
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...