Note that there are some explanatory texts on larger screens.

plurals
  1. POSelenium webdriver - Cannot locate correct Xpath/ID input field
    primarykey
    data
    text
    <p>I am trying to find the correct xpath for the html code below and after numerous trials and spending 3 days on the issue I give up and need help. Checking from IDE after recording (execute code) it correctly identifies the webeditbox called accountID but on running test script it fails to write. Please note its within a iframe and is within many classes and div boxes.</p> <p>IDE: Eclipse Juno Browser: FireFox Selenium 2 Webdriver</p> <p>HTML Code to identify web edit box: <code>&lt;input id="accountId" name="accountId" class="text" type="text" value="" maxlength="10"&gt;</code></p> <p>Selenium code used:</p> <p>1) <code>WebElement AccountID = driver.findElement(By.xpath("//[@id='accountId']")); AccountID.sendKeys("1234");</code></p> <p>2)similarly <code>//*[@id="customPMform"]/p/label</code></p> <p>3)similarly <code>//*[@id="customPMform"]/p</code></p> <p>I have tried <code>by.id</code> as well but no gain. Does anyone know what should be the right selenium code please?</p> <p>Further HTML CODE:</p> <pre><code>&lt;div class="portlet-borderless-container" style=""&gt; &lt;form id="customPMform" action="https://webcashier-stg1.egalacoral.com/web/galabingostg1-backup/prepaidcard?p_p_id=prePaidCardDeposit_WAR_prePaidCardbaseVersion60610_INSTANCE_Jl3g&amp;amp;p_p_lifecycle=1&amp;amp;p_p_state=normal&amp;amp;p_p_mode=view&amp;amp;p_p_col_id=column-1&amp;amp;p_p_col_count=2&amp;amp;_prePaidCardDeposit_WAR_prePaidCardbaseVersion60610_INSTANCE_Jl3g_action=submit" method="POST" onsubmit="return false;"&gt; &lt;input id="methodCode" name="methodCode" type="hidden" value="PrePaidCard"&gt; &lt;input id="depositSuccessUrl" name="depositSuccessUrl" type="hidden" value="/ppcdepositsuccess"&gt; &lt;input id="quickSuccessUrl" name="quickSuccessUrl" type="hidden" value="/ppcquickdepositsuccess"&gt; &lt;h2&gt;&lt;span class="text-msg" name="prePaidCardDeposit.title"&gt;PrePaid Card&lt;/span&gt;&lt;/h2&gt; &lt;p class="form"&gt; &lt;label for="accountId"&gt; &lt;span class="text-msg" name="prePaidCardDeposit.accountId"&gt;Account ID&lt;/span&gt; &lt;/label&gt; &lt;input id="accountId" name="accountId" class="text" type="text" value="" maxlength="10"&gt; &lt;/p&gt; &lt;/form&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload