Guru_Ragavendra Posted July 27, 2020 Posted July 27, 2020 $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='rdoPatientRelationshipSelf']") _WD_ElementAction($sSession,$sButton,'value','1') Exit Hi @Danp2 I try to check the Check in Chrome Automation. Could you please help me to fix this. I tried Click and Value Change Thanks in Advance Regards Ragavendran @ ALan
Danp2 Posted July 27, 2020 Posted July 27, 2020 Normally, you would just use _WD_ElementAction with the 'click' action to toggle the checkbox. Here's an example -- #include "wd_core.au3" Local $sDesiredCapabilities, $sSession, $sElement, $sElement2, $sInnerText Local $sXpath = "//input[@id='sports']" SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) If @error = $_WD_ERROR_Success Then _WD_Navigate($sSession, "https://mdn.mozillademos.org/en-US/docs/Web/HTML/Element/input/checkbox$samples/Examples?revision=1621784") $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sXpath) If @error = $_WD_ERROR_Success Then Sleep(3000) $sInnerText = _WD_ElementAction($sSession, $sElement, 'click') Sleep(3000) $sInnerText = _WD_ElementAction($sSession, $sElement, 'click') Sleep(3000) EndIf EndIf _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true}}}}' EndFunc Latest Webdriver UDF Release Webdriver Wiki FAQs
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