Seminko Posted January 4, 2017 Share Posted January 4, 2017 (edited) Hey fellas, I need to click a "link" in one of the sites, however it is not really a link I guess but more so a javascript thing ? Below is a source excerpt from the site for two employees. I guess what I need to happen is the onclick below. (The the second 0 from the right being the employee ID) onclick="window.setTimeout(function(){aspxGVCommandCustomButton('ctl00_ContentPlaceHolder1_GVSeznamZam','DET',0);},0)" However I don't seem to be able to know how. This is the code excerpt <td class="dxgv" align="right">7250</td><td class="dxgv">Test Name </td><td class="dxgv">PP</td><td class="dxgv" style="color:Red;font-family:Arial;font-size:12px;">Zadává se</td><td class="dxgvCommandColumn_Glass dxgv" align="center" style="border-right-width:0px;"><img title="Zobrazit údaje docházky" class="dxgvCommandColumnItem_Glass dxgv__cci" onclick="window.setTimeout(function(){aspxGVCommandCustomButton('ctl00_ContentPlaceHolder1_GVSeznamZam','DET',0);},0)" src="../Images/Zobrazit.gif" alt="Zobrazit údaje docházky" style="border-width:0px;cursor:pointer;" /></td> </tr><tr id="ctl00_ContentPlaceHolder1_GVSeznamZam_DXPRow0" class="dxgvPreviewRow_Glass"> <td class="dxgv" colspan="5"><table class="templateTable"><tr><td rowspan="3" style="width:10%; padding-left:5px;" ><div style=" max-width:70px; max-height:110px; "><img id="ASPxBinaryImage7250_0" style="max-width:70px; max-height:110px; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px;"src="../Uploads/Foto7250.jpg"/> </div></td><td style="width:15%; padding-left:5px;"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'>Datum nástupu:</span></td><td colspan="3" style="padding-left:3px;"><table cellpadding="0" cellspacing="0" style="width:100%"><tr><td style="width:35%;"><b><span style='font-size: 12px;font-family: Arial;color: Red;padding: 0px;'>1. 10. 2013</span></b></td><td style="width:15%"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'>Prac. pozice:</span></td><td style="width:50%"><b><span style='font-size: 12px;font-family: Arial;color: Red;padding: 0px;'>702 Z</span></b><span style='font-size: 12px;font-family: Arial;color: black;padding: 0px;'> <b> od: </b> 1. 7. 2015</span></td></tr></table></td></tr><tr><td style="width:15%; padding-left:5px;"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'></span></td><td colspan="3" style="padding-left:5px;"></td></tr><tr><td style="width:15%; padding-left:5px;"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'>Středisko:</span></td><td colspan="3" style="padding-left:3px;"><table cellpadding="0" cellspacing="0" style="width:100%"><tr><td style="width:35%;">1CZ012103 BPS - OM, OV/OE, & S2Q</td><td style="width:15%"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'>Zakázka:</span></td><td style="width:50%">BPO220112 Order Entry / Verification (TM)</td></tr></table></td></tr></table></td> </tr><tr id="ctl00_ContentPlaceHolder1_GVSeznamZam_DXDataRow1" class="dxgvDataRow_Glass dxgvDataRowAlt_Glass" style="color:Black;background-color:#C9EDF8;font-family:Arial;font-size:14px;font-weight:bold;"> <td class="dxgv" align="right">2466</td><td class="dxgv">Test Name2 </td><td class="dxgv"></td><td class="dxgv" style="color:Red;font-family:Arial;font-size:12px;">Zadává se</td><td class="dxgvCommandColumn_Glass dxgv" align="center" style="border-right-width:0px;"><img title="Zobrazit údaje docházky" class="dxgvCommandColumnItem_Glass dxgv__cci" onclick="window.setTimeout(function(){aspxGVCommandCustomButton('ctl00_ContentPlaceHolder1_GVSeznamZam','DET',1);},0)" src="../Images/Zobrazit.gif" alt="Zobrazit údaje docházky" style="border-width:0px;cursor:pointer;" /></td> </tr><tr id="ctl00_ContentPlaceHolder1_GVSeznamZam_DXPRow1" class="dxgvPreviewRow_Glass"> <td class="dxgv" colspan="5"><table class="templateTable"><tr><td rowspan="3" style="width:10%; padding-left:5px;" ><div style=" max-width:70px; max-height:110px; "><img id="ASPxBinaryImage2466_0" style="max-width:70px; max-height:110px; border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px;"src="../Uploads/Foto2466.jpg"/> </div></td><td style="width:15%; padding-left:5px;"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'>Datum nástupu:</span></td><td colspan="3" style="padding-left:3px;"><table cellpadding="0" cellspacing="0" style="width:100%"><tr><td style="width:35%;"><b><span style='font-size: 12px;font-family: Arial;color: Red;padding: 0px;'>5. 5. 2008</span></b></td><td style="width:15%"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'>Prac. pozice:</span></td><td style="width:50%"><b><span style='font-size: 12px;font-family: Arial;color: Red;padding: 0px;'>701 Z</span></b><span style='font-size: 12px;font-family: Arial;color: black;padding: 0px;'> <b> od: </b> 1. 9. 2012</span></td></tr></table></td></tr><tr><td style="width:15%; padding-left:5px;"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'></span></td><td colspan="3" style="padding-left:5px;"></td></tr><tr><td style="width:15%; padding-left:5px;"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'>Středisko:</span></td><td colspan="3" style="padding-left:3px;"><table cellpadding="0" cellspacing="0" style="width:100%"><tr><td style="width:35%;">1CZ012103 BPS - OM, OV/OE, & S2Q</td><td style="width:15%"><span class='TextZakladniBold' style='font-size: 12px;font-family: Arial;color: 'black';padding: 0px;'>Zakázka:</span></td><td style="width:50%">BPO220112 Order Entry / Verification (TM)</td></tr></table></td></tr></table></td> </tr><tr id="ctl00_ContentPlaceHolder1_GVSeznamZam_DXDataRow2" class="dxgvDataRow_Glass" style="color:Black;background-color:#E5F4F9;font-family:Arial;font-size:14px;font-weight:bold;"> Edited January 4, 2017 by Seminko Link to comment Share on other sites More sharing options...
Danp2 Posted January 4, 2017 Share Posted January 4, 2017 The onclick code is associated with an image, so I would suggest trying _IEImgClick, ie: _IEImgClick($oIE, "Zobrazit údaje docházky", "alt") _IEImgClick($oIE, "Zobrazit údaje docházky", "alt", 1) Seminko 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Seminko Posted January 4, 2017 Author Share Posted January 4, 2017 (edited) Ha! the Second one works great! Thanks mate! I have one more thing related to this. Let me write it up. Edited January 4, 2017 by Seminko Link to comment Share on other sites More sharing options...
Seminko Posted January 4, 2017 Author Share Posted January 4, 2017 There is also this piece of code which manages a dropdown menu. I want the script to click to initiate the dropdown and then select: <td class="dxeListBoxItem_Glass">Všechny záznamy</td> <td style="display:none;"><input id="ctl00_ContentPlaceHolder1_DLPocetVet_VI" name="ctl00_ContentPlaceHolder1_DLPocetVet_VI" type="hidden" value="5" /></td><td class="dxic" onmousedown="return aspxDDDropDown('ctl00_ContentPlaceHolder1_DLPocetVet', event)" style="width:100%;padding-left:1px;padding-right:1px;padding-top:1px;padding-bottom:1px;"><input class="dxeEditArea_Glass dxeEditAreaSys" name="ctl00$ContentPlaceHolder1$DLPocetVet" value="5 záznamů" id="ctl00_ContentPlaceHolder1_DLPocetVet_I" onchange="aspxETextChanged('ctl00_ContentPlaceHolder1_DLPocetVet')" onblur="aspxELostFocus('ctl00_ContentPlaceHolder1_DLPocetVet')" onfocus="aspxEGotFocus('ctl00_ContentPlaceHolder1_DLPocetVet')" type="text" onkeydown="aspxEKeyDown('ctl00_ContentPlaceHolder1_DLPocetVet', event)" readonly="readonly" style="height:15px;cursor:default;" /></td><td id="ctl00_ContentPlaceHolder1_DLPocetVet_B-1" class="dxeButtonEditButton_Glass" onmousedown="return aspxDDDropDown('ctl00_ContentPlaceHolder1_DLPocetVet', event)" style="width:13px;-khtml-user-select:none;"><table class="dxbebt" cellspacing="0" cellpadding="0" style="width:13px;border-collapse:collapse;border-collapse:separate;"> <tr> <td class="dx"><img id="ctl00_ContentPlaceHolder1_DLPocetVet_B-1Img" class="dxEditors_edtDropDown_Glass" src="/DXR.axd?r=1_3-wJEc3" alt="v" style="border-width:0px;" /></td> </tr> </table></td> </tr> </table><input type="hidden" id="ctl00_ContentPlaceHolder1_DLPocetVet_DDDWS" name="ctl00_ContentPlaceHolder1_DLPocetVet_DDDWS" value="0:0:-1:-10000:-10000:0:-10000:-10000:1" /><div id="ctl00_ContentPlaceHolder1_DLPocetVet_DDD_PW-1" style="position:absolute;left:0px;top:0px;z-index:10000;visibility:hidden;display:none;"> <table id="ctl00_ContentPlaceHolder1_DLPocetVet_DDD_PWST-1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border-collapse:separate;position:relative;"> <tr> <td onmousedown="aspxPWMDown(event,'ctl00_ContentPlaceHolder1_DLPocetVet_DDD',-1,false)" style="width:200px;cursor:default;"><table id="ctl00_ContentPlaceHolder1_DLPocetVet_DDD_CLW-1" cellspacing="0" cellpadding="0" style="width:200px;border-collapse:collapse;border-collapse:separate;"> <tr> <td id="ctl00_ContentPlaceHolder1_DLPocetVet_DDD_PWC-1" style="height:100%;"><table class="dxeListBox_Glass" cellspacing="0" cellpadding="0" id="ctl00_ContentPlaceHolder1_DLPocetVet_DDD_L" style="border-collapse:collapse;border-collapse:separate;"> <tr> <td valign="top"><div id="ctl00_ContentPlaceHolder1_DLPocetVet_DDD_L_D" class="dxlbd" style="width:100%;overflow-x:hidden;overflow-y:auto;"> <input id="ctl00_ContentPlaceHolder1_DLPocetVet_DDD_L_VI" type="hidden" name="ctl00$ContentPlaceHolder1$DLPocetVet$DDD$L" /><table id="ctl00_ContentPlaceHolder1_DLPocetVet_DDD_L_LBT" cellspacing="0" cellpadding="0" style="width:100%;border-collapse:collapse;border-collapse:separate;"> <tr class="dxeListBoxItemRow_Glass"> <td class="dxeListBoxItem_Glass">5 záznamů</td> </tr><tr class="dxeListBoxItemRow_Glass"> <td class="dxeListBoxItem_Glass">10 záznamů</td> </tr><tr class="dxeListBoxItemRow_Glass"> <td class="dxeListBoxItem_Glass">15 záznamů</td> </tr><tr class="dxeListBoxItemRow_Glass"> <td class="dxeListBoxItem_Glass">30 záznamů</td> </tr><tr class="dxeListBoxItemRow_Glass"> <td class="dxeListBoxItem_Glass">45 záznamů</td> </tr><tr class="dxeListBoxItemRow_Glass"> <td class="dxeListBoxItem_Glass">Všechny záznamy</td> </tr> </table> </div></td> </tr> </table><script id="dxss_889372391" type="text/javascript"> Link to comment Share on other sites More sharing options...
Danp2 Posted January 4, 2017 Share Posted January 4, 2017 Under normal circumstances, this would be accomplished with _IEFormElementOptionSelect. In your case, it looks like the site is using a custom combo box so I don't know offhand how to assist you. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Juvigy Posted January 5, 2017 Share Posted January 5, 2017 That's an input element. Try this example: #include <IE.au3> Local $oIE = _IE_Example("form") Local $oInputs = _IETagNameGetCollection($oIE, "input") For $oInput In $oInputs MsgBox(0, "Form Input Type", "Form: " & $oInput.form.name & " Type: " & $oInput.innerhtml) Next After that you will need to set a value for it. Try with $oInput.value = "Všechny záznamy" or = "Všechny znamy" Link to comment Share on other sites More sharing options...
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