在div里面的iframe里面的复选框的X路径

时间:2016-07-28 16:37:28

标签: xpath

对于我的生活,我无法得到这个的xpath .... 我认为问题是有两个div,称为' div_settings_A'和' div_settings_C',在下面的示例中,您无法看到' div_settings_C'因为它隐藏起来,只是不知道为什么它不会工作!

我试过了

  

// div [包含(@id,' div_settings_A')] /输入
  // tr [@id =' inputSavePaymentAccounts']和td [@name =' payAck']

<iframe id="ccPayWiz" class="ui-dialog-content ui-widget-content" src="ccxPaymentDetails.php?c=1805&a=733344&d=null&m=Automation@billtrust.com&b=768866910" style="width: 99%; min-height: 105.833px; height: 717px; position: relative;" scrolltop="0" scrollleft="0">
    <!DOCTYPE html>
    <html>
        <head>
            <body style="border: 0px; margin: 0px; padding: 0px;" onload="setuppanes('IG');">
                <input id="wpsURL" type="hidden" value="WPS_URL">
                    <form id="frmPay" onsubmit="return paywizAccountHelper.validateForm(this, '17', 'US');" action="ccProcessPayment.php" method="post" name="frmPay">
                        <input type="hidden" name="csrf" value="e5297f08b85318aa2ec176a5d8fac2a2">
                            <div id="divPayWizard2">
                                <div style="float:left; margin-top:5px">
                                    <ul class="steps ui-widget ui-helper-clearfix">
                                        <li>
                                            <li>
                                                <li>
                                                </ul>
                                            </div>
                                            <br clear="all">
                                                <hr>
                                                    <p>
                                                        <span class="cc-font"> Enter the customer's billing information to process the payment.</span>
                                                    </p>
                                                    <div id="divpane1">
                                                        <table id="tablepane1" class="cc-pane1-table cc-font">
                                                            <br>
                                                            </div>
                                                            <div id="divpane2">
                                                                <table class="cc-pane2-table-top cc-font">
                                                                </div>
                                                                <div id="div_settings_A" style="display: block;">
                                                                    <input type="hidden" value="733344" name="SrchAcctNum">
                                                                        <table class="cc-font" width="700" cellspacing="3" border="0">
                                                                            <input id="BankCountry" type="hidden" value="US" name="BankCountry">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <tr>
                                                                                            <tr>
                                                                                                <tr>
                                                                                                    <tr>
                                                                                                        <tr>
                                                                                                            <tr>
                                                                                                                <tr>
                                                                                                                    <tr>
                                                                                                                        <tr id="inputSavePaymentAccounts" class="savePaymentAccounts" style="display: table-row;">
                                                                                                                            <td class="addCCLabel" style="padding-top: 15px">Save this Payment Method</td>
                                                                                                                            <td style="padding-top: 15px">
                                                                                                                                <input class="payAck" type="checkbox" name="payAck" style="margin: 0; padding 0" tabindex="9">
                                                                                                                                </td>
                                                                                                                            </tr>

1 个答案:

答案 0 :(得分:1)

您可以使用name属性直接获取该ccheck box元素:

.//input[@type = 'checkbox' and @name = 'payAck']

如果有多个具有相同名称的复选框,请尝试使用descendant tr作为:

.//tr[@id = 'inputSavePaymentAccounts']/descendant::input[@type = 'checkbox' and @name = 'payAck']

.//tr[@id = 'inputSavePaymentAccounts']/descendant::input

希望它有帮助...:)