2
votes

I'm new to selenium so I've been using the IDE to create tests. I have this problem where Selenium sees a button associated with a drop down menu, but it won't click the button. To get around this i want Selenium to type the URL (for the button i want clicked) into the address bar of fire fox, or I want selenium to just go to said URL via some command, but i can't find said command, and i can't get Selenium to click and type in the address bar.

3

3 Answers

6
votes

You can use open command and type the expected url. Just right click on the command window and Insert New Command and follow the screenshot. However, you should find a better way to click the button instead. enter image description here

1
votes

I found the open(url) command after i posted this.

0
votes

The open command would be the way to go here, but might I reccomend also adding in a store command, rather than having the script reference the URL directly. If for any reason the URL on the button changed it would mean amending the script, however if for example you went with

<tr>
    <td>storeAttribute</td>
    <td>id=Button-Locator@href</td>
    <td>url</td>
</tr>
<tr>
    <td>open</td>
    <td>${url}</td>
    <td></td>
</tr>

It would mean less upkeep on the script in the event of URL changes