Jump to content

Recommended Posts

Posted

how to make click actions on menu

For example "ABOUT US" in the screenshot given inspect element as well 

please help me with that

Capture3.PNG

Posted

#include "wd_core.au3"
#include "wd_helper.au3"
Local $sDesiredCapabilities, $sSession
SetupChrome()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://www.fhlbny.com")
$lPartial = True
$sText="menu-item-5075"
_WD_LinkClickByText($sSession, $sText, $lPartial)

Func SetupChrome()
_WD_Option('Driver', 'chromedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}'
EndFunc

Func _ChromeSetInputValueById($sSession, $Id, $Value)
    $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']")
    _WD_ElementAction($sSession, $sButton, 'value', $Value)
EndFunc

Capture4.PNG

Posted

@tak09 Please reread my earlier post, which explains how to properly post code on the forum. It also requests that you post text and not a screenshot when possible. :rolleyes:

As far as your current issue, "menu-item-5075" is the id for a completely different element. That function is designed to search for the link's text. Therefore, you want to use something like this --

_WD_LinkClickByText($sSession, "ABOUT US")

 

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...