Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This should be possible in Selenium as others have noted.</p> <p>I have used Selenium to login then crawl a site and discover every permuation of values for every form on the site (30+ forms). These values are later used to fill and submit the form with a specific perumation of values. This site was very JS/jQuery heavy and I used Selenium's built-in support of javascript executor, css selectors, and XPath to accomplish this.</p> <p>I implemented HtmlUnit and HttpUnit as faster alternatives, but found they were not as reliable as Selenium given the JS semantics of the site I was crawling.</p> <p>It's hard to give you code on how to accomplish it because your Selenium implementation will be quite page-specific and I can't look at the page you're coding against to figure out what's going on with that button script junk. However, I have include some possibly relevant selenium code (Java) snippets:</p> <pre><code>Element element = driver.findElements(By.id(value)); //find element on page List&lt;Element&gt; buttons = parent.findElements(By.xpath("./tr/td/button")); //find child element button.click(); element.submit() //submit enclosing form element.sendKeys(text); //enter text in an input String elementText = (String) ((JavascriptExecutor) driver).executeScript("return arguments[0].innerText || arguments[0].textContent", element); //interact with a selenium element via JS </code></pre> <p>If you are coding similar functions on different pages, then <a href="http://code.google.com/p/selenium/wiki/PageObjects" rel="nofollow">PageObjects</a> behind interfaces can help.</p> <p>The link Anew posted is a good starting point and good ol' StackOverflow has answers to just about any Selenium problem ever.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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