Jump to content

Recommended Posts

Posted
ControlClick($hWnd, "", "Intermediate D3D Window1","left",669,408,2)

ControlSend($hWnd, "", "Intermediate D3D Window1", "{TAB}")
Sleep(1000)
ControlSend($hWnd, "", "Intermediate D3D Window1", "{ENTER}")

Hello,

I tried to use the control send and control click in my edge browser using WD UDF, but it is not working. I am already using the commands in IE browser and its working. Any difference for using Control commands for different browser or it is same for all.

Posted

When i will give the website in browser, it will open the form where i have to fill details and then i have to click on Request  to go next page. Below is the HTML code for that :

<input type="submit" class="btn btn-primary" value="Request">

I tried to use some of the commands but it is not working, so i used the control command to hit enter on Request.

 

Posted
#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)
Sleep(2000)
 $sUsername = _WD_GetElementById($sSession,"userid")
_WD_SetElementValue($sSession,$sUsername, "abc")

Sleep(2000)

$sEmail = _WD_GetElementById($sSession,"email")
_WD_SetElementValue($sSession,$sEmail, "abc.com")

Sleep(2000)


;For hitting enter on Request button

Local $hWnd = WinWait("Microsoft? Edge","",5)

WinActivate($hWnd)

ControlClick($hWnd, "", "Intermediate D3D Window1","left",669,408,2)

ControlSend($hWnd, "", "Intermediate D3D Window1", "{TAB}")
Sleep(1000)
ControlSend($hWnd, "", "Intermediate D3D Window1", "{ENTER}")

Func SetupEdge()

_WD_Option('Driver', 'msedgedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--verbose')

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & StringReplace (@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false}}}}'

EndFunc

_WD_DeleteSession($sSession)
_WD_Shutdown()

This is the code i am using WD UDF

Posted

I tried the commands but still it is not clicking. I used even clickby text but no success. Even SCITE output not showing any error.

$sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='submit']")
_WD_ElementAction($sSession, $sElement, 'value', "Request")
    _WD_ElementAction($sSession, $sButton, 'click')

 

Posted
$sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='submit']")
    _WD_ElementAction($sSession, $sButton, 'click')

I used this but no success of clicking on Request

Posted
$sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit']")
    _WD_ElementAction($sSession, $sButton, 'click')

I tried this and its working fine.:)

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
  • Recently Browsing   0 members

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