9tailsfox Posted August 16, 2018 Posted August 16, 2018 <td class="txt"> <div class="dijit dijitReset dijitInline dijitLeft dijitTextBox dijitComboBox" id="widget_manifest" role="combobox" widgetid="manifest" aria-labelledby="manifest_label" aria-expanded="false"><div class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="_buttonNode, _popupStateNode" role="presentation" popupactive="true"><input class="dijitReset dijitInputField Hi how do I write to autoit script by above given source code? I need to click it and as I know it has related to Xpath. So please help me how to link the xpath. thanks
jdelaney Posted August 16, 2018 Posted August 16, 2018 (edited) You can right click any node in the DOM (send F12 at your browser), and copy > xpath with almost all browsers. If you use IE, you can then send that xpath at the function in my signature. Edited August 16, 2018 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
9tailsfox Posted August 16, 2018 Author Posted August 16, 2018 (edited) Hi Thanks for the reply. I believe the xpath is this $xpath = "//*[@id="widget_manifest"]/div[1]". Yes I browse your signature and I still could not understand. So how do I make this thing able to click? Edited August 16, 2018 by 9tailsfox
9tailsfox Posted August 16, 2018 Author Posted August 16, 2018 (edited) HI I've found the Xpath by using the chroPath tool. below is the script that I've wrote. It doesn't work. please help thanks Local $o_manifest = _IEGetObjByID($oIE, "manifest") Local $oxpath = "//div[@id='widget_manifest']//div[@class='dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer']" Local $o_manifest2 = _IEGetObjByID($oIE, $oxpath) _IEAction($o_manifest2, "focus") _IEAction($o_manifest2, "click") Edited August 16, 2018 by 9tailsfox
FrancescoDiMuro Posted August 16, 2018 Posted August 16, 2018 @9tailsfox Put some error checking after your function calls, so you can see if there is a specific error. ; Function Call If @error Then ConsoleWrite("Error calling function FunctionName. Error: " & @error & @CRLF) Else ; Some code... EndIf Click here to see my signature: Reveal hidden contents ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Danp2 Posted August 16, 2018 Posted August 16, 2018 On 8/16/2018 at 6:50 AM, 9tailsfox said: Local $o_manifest2 = _IEGetObjByID($oIE, $oxpath) Expand You can't pass the xpath string to _IEGetObjByID. It doesn't work like that. You'll need to download the xpath UDF from here and pass the string to it instead. Latest Webdriver UDF Release Webdriver Wiki FAQs
9tailsfox Posted August 17, 2018 Author Posted August 17, 2018 Pardon me as I'm asking silly questions. I'm really bad on coding and after I downloaded the UDF and I replace the xpath like below. is that correct? #region SAMPLE ; Using multiple levels as an example...made comples on purpose to demonstrate...: $xpathForumLink = "//div[@id='widget_manifest']//div[@class='dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer']" $xpathGeneralHelpSuprt = "//div[@id='widget_manifest']//div[@class='dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer']" ; Click the Last page avaiable on the page navigation...which happens to be page 6 $xpathGeneralHelpPagination = "//ul[@class='ipsPagination']/li[last()-3]/a"
Danp2 Posted August 17, 2018 Posted August 17, 2018 You've created three variables each with a different xpath definition. Now you need to call the actual function from the UDF and pass it one of these variables. 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