Danp2 Posted June 10, 2020 Posted June 10, 2020 First you have to locate the element using _WD_FindElement. Then you click on it using _WD_ElementAction. Latest Webdriver UDF Release Webdriver Wiki FAQs
tak09 Posted June 10, 2020 Author Posted June 10, 2020 #include "wd_core.au3" #include "wd_helper.au3" ;Local variables Local $sDesiredCapabilities, $sSession ;Start chrome SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.fhlbny.com") _WD_LoadWait($sSession) WinSetState("[ACTIVE]", "", @SW_MAXIMIZE) _WD_LoadWait($sSession) _WD_LinkClickByText($sSession, "ABOUT US") _WD_LoadWait($sSession) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='logo']") _WD_ElementAction($sSession, $sElement, "click") <img src="/wp-content/uploads/2020/02/FHBLNY-logo.png" alt="Federal Home Loan Bank of New York" id="logo" data-height-percentage="100" data-actual-width="324" data-actual-height="284"> i tried this but not working
Danp2 Posted June 10, 2020 Posted June 10, 2020 Your xpath is wrong (img <> input). Latest Webdriver UDF Release Webdriver Wiki FAQs
tak09 Posted June 10, 2020 Author Posted June 10, 2020 _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//img <'logo'> input") still not working
Danp2 Posted June 10, 2020 Posted June 10, 2020 In my earlier post, the point I was trying to make is that you can't use an xpath with "input" to retrieve an "img" element. Therefore, the correct statement would be $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//img[@id='logo']") Latest Webdriver UDF Release Webdriver Wiki FAQs
tak09 Posted June 10, 2020 Author Posted June 10, 2020 @Danp2 its working, you are genius thanks again
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now