Jump to content

Xpath Click


Recommended Posts

<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 

Link to comment
Share on other sites

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 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.
Link to comment
Share on other sites

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 by 9tailsfox
Link to comment
Share on other sites

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 by 9tailsfox
Link to comment
Share on other sites

@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:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

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"
 

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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