selenium-rc

Open a URL with parameters using selenium.open()

I am using selenium.open(), to open a URL, which prints the cookie output to the browser window: String cookiestr = "http://my.server.com/cookie?out=text"; selenium.open( cookiestr ); The problem is that, it opens a "Save As..." popup, to save the file named "cookie". When I open the same URL in my browser directly, it displays text i...

Sending multiple requests simultaneously to the Server using Selenium with Java

I wish to send multiple requests to the server, simultaneously. The problem statement will be: Read a text file containing multiple URL’s. Open each URL in the web browser. Collect the Cookie information for each call, and store it to a file. Send another call: http://myserver.com:1111/cookie?out=text Store the output (body text) o...

I want to generate XML oupt result with Selenium R. How to do ?

Hi, I create a test suite with Selenium IDE. I use a ant task to execute it with htmlSuite but the result is created in HTML. How can I generate the result into JUnit XML output understandable by Bamboo ? Thanks a lot ...

selenium rc captureEntirePageScreenshotToString triggers FileNotFoundException

Hi, I'm using selenium rc to do functional website testing and I've recently experienced a mysterious issue with safari and opera. When a test fails I make a screenshot using the captureEntirePageScreenshotToString command as well as retrieving the html source. Sometimes however this fails with a FileNotFoundException: java.io.FileNotF...

Selenium RC: How to check if an element has a given attribute?

I have some buttons with an onclick attribute and some that don't. I want to check if the specified element has the onclick attribute. How can I do this? getAttribute() returns the attribute value when it has one. When it doesn't, it throws a RuntimeException and stops the test (even when I wrap it in a try/catch block). $onclickValue ...

Selenium and :hover css

Using selenium-rc and the java client, I want to test a menu which opens when the user moves the mouse over it. It closes when the mouse leaves the menu. This is done using :hover css, without any javascript. In selenium, there are many methods for mouse actions, but none of them seems to trigger any css :hover style to be used. Googl...

Selenium RC: Selecting elements using the CSS :contains pseudo-class

I would like to assert that a table row contains the data that I expect in two different tables. Using the following HTML as an example: <table> <tr> <th>Table 1</th> </tr> <tr> <td>Row 1 Col 1</td> <td>Row 1 Col 2</td> </tr> </table> <table> <tr> <th>Table 2</th> </tr> <tr> ...

How do I change Firefox config programatically at runtime?

I want to use selenium/JUnit to do some mobile emulator testing using the FireMobileSimulator plugin. Given that the plugin can emulate a number of different phones, I'd like to be able to cycle through testsswapping out devices as required. The device being emulated is controlled by two config options. Being able to manipulate these pr...

How to use browser options in selenium?

I have a browser which takes certain parameters as options as shown below. testbrowser.exe -id=test -url=http://www.google.com/. Below is my selenium code. selenium = new DefaultSelenium("localhost", 4444, "*custom "+testBrowser+" -id=test -url=", "http://www.google.com/"); selenium.start(); selenium.open("http://www.yahoo.com"); W...

Selenium get dynamic id from xpath

Is there a way in Selenium RC to get the id from the xpath? If I have the xpath /html/body/div/div//input I want to get the id of all the nodes associated to the xpath ...

Can't get the value of an attribute with Selenium RC using xpath

I'm trying to get the first href attribute in a page using Selenium RC (in Python): sel.get_text("xpath=//@href") this returns an empty string. However, an identical xpath on the same page inside Firefox (using the "View XPath" extension) yields the correct value. I've tried fiddling with it, but the same happens for other attribute...

How to iterate with Selenium RC over XPath results directly?

I'm currently resorting to first doing a get_xpath_count, and then creating a loop incrementing an index variable, which in turn I inject back into the original xpath to select the nth result... very awkward no doubt. Is there some simple, direct, elegant way to iterate directly over the xpath results? Thanks! ...

How to use unicode inside an xpath string? (UnicodeEncodeError)

I'm using xpath in Selenium RC via the Python api. I need to click an a element who's text is "Submit »" Here's the error that I'm getting: In [18]: sel.click(u"xpath=//a[text()='Submit \xbb')]") --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent...

How to access non-first matches with xpath in Selenium RC ?

I have 20 labels in my page: In [85]: sel.get_xpath_count("//label") Out[85]: u'20' And I can get the first one be default: In [86]: sel.get_text("xpath=//label") Out[86]: u'First label:' But, unlike the xpath docs I've found, I'm getting an error trying to subscript the xpath to get to the second label's text: In [87]: sel.get_te...

How to iterate through table using selenium?

I have a table called UserManagement that contains information about the user.This table gets updated whenever new user is created. If i create two users then i need check whether two users are actually created or not. Table contains ID,UserName,FirstName,LastName,Bdate..ctc. Here ID will be generated automatically. ...

Selenium RC htmlsuite error

I am trying to use Selenium RC but i keep getting this error whenever i start the server. The command i use is java -jar selenium-server.jar -multiwindow -htmlsuite *iexplore http://localhost/app testsuite.html testsuiteoutfile.html Starting Selenium Server.... 18:14:29.086 INFO - Java: Sun Microsystems Inc. 10.0-b23 18:...

Configuring Selenium RC with Perl

I want to use Selenium RC with a Perl client driver. How can I configure Selenium RC with Perl? ...

Selenium rc open only the remote control windows an does not display the second browse

I have selenium server 1.03 runing on Ubuntu 9.10 with FF 3.5.3. I use the following code : require 'selenium/client' .... @selenium = Selenium::Client::Driver.new \ :host => "10.0.215.3", :port => 4444, :browser => "*firefox", :url => "http://www.google.fr/", :timeout_in_second => 5 .... .... @selenium.start @selenium.set_co...

Selenium: Why does click() not behave like it does in firefox?

I have a link with an id: <a href="#" onclick="return false();" id="lol"> In my test: selenium.click("lol"); //when running the test, the click will just end up selecting the item, not firing off the frameworks javascript This does not register the click the same! There is javascript that is part of a complex framework which will c...

Selenium RC fails to setup Internet Explorer to run tests

So I created a test that runs fine in fire fox super.setUp("*chrome");. And now I try to run this on my machine for internet explorer super.setUp("*iexplore"); //not iexplorer!. This works fine on another developers machine, we both use vista and are running Iexplorer 8. However on my machine, the page is blank and the URL is this: C:\Us...