eskoba
eskoba

Reputation: 566

selenium ide can't find element unless I execute command one by one

I am using selenium ide to automatise my tests. I after clicking on the link, I get a popup window, which has a div containing a text. I am not able to get the text in the div tag, unless I double click on it or execute the command singlely. I have tried the following but none of them seems to work:

wait up to 1 min; wait for the element to be present, event after 1 min of waiting. But can't find element; identify the popup window by title, but it is not even identifying the window.

However waitForPopup is working, but then can't find the element on the popup.

Here is my code

<tr>
<!-- this passed -->
    <td>waitForElementPresent</td>
    <td>//a[@id='linkTopopup']</td>
    <td></td>
</tr>
<tr>
<!-- this passed -->
    <td>pause</td>
    <td>1000</td>
    <td></td>
</tr>
<tr>
<!-- this passed -->
    <td>click</td>
    <td>//a[@id='linkTopopup']</td>
    <td></td>
</tr>
<tr>
<!-- this passed -->
    <td>waitForPopUp</td> 
    <td></td>
    <td>30000</td>
</tr>
<tr>
    <td>waitForElementPresent</td>
    <td>//div[@id='divHavingText']</td><!-- this is where I can't find the 
element -->
    <td></td>
</tr>
<tr>
    <td>storeText</td>
    <td>//div[@id='divHavingText']</td><!-- this is where I can't find the element -->
    <td>myText</td>
</tr>

<div id='divHavingText'>
    hi
</div>

Does any has any idea on why this won't find the element unless double click, not when I run the entire test case automatically?

Upvotes: 0

Views: 191

Answers (1)

satheesh kumar P
satheesh kumar P

Reputation: 43

You can wait until alert comes, using "waitForAlert" command. not by simply waiting.

Upvotes: 0

Related Questions