English 中文(简体)
How do I select html injected from jQuery with Selenium IDE?
原标题:

I m currently using Selenium IDE to fill a form. The form has a select box for countries:

<select id="id_country">
    <option>Canada</option>
    <option>England</option>
</select>

<select id="id_province"></select>

The province options above is not generated until a country with provinces is selected. jQuery takes care of that generation:

options =  <options>Alberta</options><options>Ontario</option> ;
$( #id_province ).html(options);

My Selenium IDE workflow looks like the following:

Command       Target           Value
select        id_country       label=Canada
select        id_province      label=Ontario

After Canada is selected, Alberta shows up as the default province but Ontario is not selected and I get the following error in my log:

[error] Option with label  Ontario  not found

Does anyone know which Selenium IDE command I should specify to properly select a generated HTML from Javascript?

最佳回答

You probably need to pause while the thing loads, using a waitFor assertion, e.g.

Command                 Target                Value
waitForSelectOptions    id_province           glob:*Ontario*
问题回答

暂无回答




相关问题
Javascript communication with Selenium (RC)

My Application has a lot of calculation being done in JavaScript according to how and when the user acts on the application. The project prints out valuable information (through console calls) as to ...

Running automated Web browser tests under Hudson

I m running Hudson for my automated builds and love it. I d now like to create automated Web browser tests using either WaTiN (preferred) or Selenium. As my Hudson runs as a Windows service (under ...

Using a Java library with Scala reserved words

I m using an external library written in Java (Selenium). One of the function calls has the signature type(String, String), and I keep getting compiler errors when trying to call it from Scala, that ...

Heightened privilege selenium browsers on Windows 7 (x64)

I make use of *firefox and *iexplore etc. within my selenium tests to get around the issue of self-signed SSL certificates on my local machine. Unfortunately, now that I ve moved from XP over to 7, ...

Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Selenium IDE: Incrementing values by 1 and 71

Currently I m incrementing a value called wert by 1 with the following code: getEval storedVars[ wert ]=${wert}+1; The value wert is something like 80401299. I want to add 1 to the value, if it ...

热门标签