Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suppose you know how to extract the data from the excel that you post in your code above.</p> <p>For the part of find the text box in the page using XPath, I think is more easy if you user CSS-Selectors instead of XPath because XPath its a little difficult for newbies in this fields and tends to change. </p> <p>If we take the text box that appears in the upper right corner of the page of StackOverflow that executes a search of example , the HTML code in the page its the following :</p> <pre><code>&lt;input class="textbox" type="text" value="" size="28" maxlength="240" tabindex="1" placeholder="search" name="q" autocomplete="off"&gt;&lt;/input&gt; </code></pre> <p>My suggestion is use the following code :</p> <pre><code>Cell cells = null; Cell idcell=null; if (checking.equalsIgnoreCase("xxxxxxxxxxxxx")) { System.out.println("Checking xxxxxxxxxxxx"); if (checking.equalsIgnoreCase("yyyyyyyyyyyy")){ for (int cols = 0; cols &lt; sheet.getColumns(); cols++) { cells = sheet.getCell(cols, rows); idcell = sheet.getCell(cols,rows); WebElement element_BuyCategory = driver.findElement( By.cssSelector( "#search div input.textbox "); /* Other way is find the element by its name, if its have a name */ WebElement element_BuyCategory_by_Name = driver.findElement( By.name("q"); element_BuyCategory.sendKeys(cells.getContents()); System.out.println("xpath ok"); } } </code></pre> <p>If for some case you want to use XPath the you need to substitute the line of find the element with the next line :</p> <pre><code>/* If it's the only text box with this class or it's the first, I repeat this is a example */ WebElement element_BuyCategory = driver.findElement By.xpath("//input[contains(@class,'textbox')")); </code></pre> <p>I hope that the examples explained above can help you.</p>
    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.
 

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