selenium

Selenium more than one baseUrl per test class

I am writing selenium scripts on a complex web based application. To use a useraccount I need to register first using one URL and then approve the account in the admin console on another URL. The problem is that there is another baseURL for registration and admin console and I need that in one unittest. But when I use setBaseUrl in my...

Testing drag-and-drop with Watir

I'm evaluating Watir right now. While Selenium has a dragAndDropToObject command (which seems to be broken) Watir seems not to have such a command. I couldn't find a script/tutorial with an example of how to test DnD with Watir. Did anybody try/succeed in testing drag-and-drop with Watir? Btw.: I am using jQuery for the DnD implementat...

How to I add a JQuery locators to Selenium Remote Control

Hi, I've been using XPath with Selenium quite happily and even using getEval with a but of Javascript, but a colleague said wouldn't it be great to be able to use JQuery selectors in Selenium. I've googled it, but can't find any articles that seem to work for me. Could anyone provide a comprehensive guide on how to use JQuery syntax to ...

selenium scripts

I want to use selenium scripts to click on a bunch of links on my webpage one by one, each click results in a page refresh. However selenium doesn't support css pseudo class like :visited, so I can't distinguish the ones that are already clicked from the ones that I want to click on next. Is there a way to solve my problem? here's my ...

Selenium: How to select an option from a select menu?

I am writing a Selenium test in PHP using the PHPUnit Selenium extension. I know how to type something into a text field: $this->type('fieldName', 'value'); But how do I select an option from a drop-down menu? ...

Creating parallel selenium tests in C# and using Nunit as the runner application

I am writing a new test suite for the company to test a very complex ASP.NET application which is heavily AJAX driven. We have decided to use Selenium (Grid & Remote Control) and Nunit to run these tests. The actually tests are dynamically created at run time from a spreadsheet. Each Column in an excel spreadsheet relates to a new test...

Selenium: How to assert that a text field is disabled?

I am using the PHPUnit Selenium Extension for Selenium RC. I am able to assert the field is present: $this->assertElementPresent('Date'); But how do I assert that the field is disabled (or not editable)? ...

Selenium: How to click an HTML button element?

I have button on the page that being used as a link to another page. So when the user clicks the button they are redirected to the right page. I am using the Selenium extension for PHPUnit and I would like to test that the button is correctly redirecting the user. Here is the HTML that I am trying to test: <button onclick="window.locat...

capybara selenium and JavaScript Destroy

I am using rails 2.3.5 and this is what I did. I have latest cucumber, cucumber-rails and capybara installed. rails demo cd demo ruby script/generate cucumber --rspec --capybara ruby script/generate feature post title:string body:text published:boolean ruby script/generate scaffold post title:string body:text published:boolean rake db:m...

How to generate a random number

I have to create a test for homework using Selenium IDE and create a scenario to generate a random number. I'm stuggling with what I need to type and what field to type in. What should I type in?: Command Target Value Thanks ...

How to get selenium to wait for ajax response?

How can I get selenium to wait for something like a calendar widget to load? Right now I am just doing a Thread.sleep(2500) after exporting the testcase to a junit program. ...

Selenium RC:How to launch Interactive testing with Multiple browsers

I want to automate this scenario. UserA assign an item to UserB, who gets an alert message. In order to do this I want to have two different browsers launched with different accounts to test this interaction. Is is possible to do this? If yes, how? ...

How to get selenium to click on an object other than by ID

So here is a little challenge. I have an image. It has 2 attributes: a random ID - not helpful an image url - but it is a button, and other buttons use the same image url, not helpful a CSS class - also used by too many other things to be helpful a style - neither helpful nor unique This image is however inside of an anchor tag, but ...

ASP.NET MVC Head Verb and Selenium RC

Selenium (RC) is being used to test an ASP.NET 1.1 site. When we make a request via Selenium RC (which in turn automates the request via a configured browser - in this case Firefox) the http verb is "HEAD". We have several form action methods that have separate GET and POST methods decorated with AcceptVerbs(HttpVerbs.Get) or HttpVerbs...

How to click an element by innerthtml using CSS selectors in Selenium

I have HTML code like this <td>Save</td> I couldn't locate the element using FireFinder by td:contains("Save") Is FireFinder wont support the :contains or innerHTML cant be located by :contains? Read that in Selenium too, :contains wont be supported? However, I couldn't find a documentation for that. ...

Selenium RC throws sessionsid should not be null exception with assertTextPresent, phpunit 3.4 bug only?

I am looking to migrate my selenium RC tests to using PHPUnit 3.4.12 from PHPUnit 3.3.2 The selenium test will fail with an exception of the following when I use assertTextPresent() PHPUnit_Framework_Exception: Response from Selenium RC server for getLocation(). ERROR Server Exception: sessionId should not be null; has this session be...

PHPUnit Selenium captureScreenshotOnFailure does not work?

I am using PHPUnit 3.4.12 to drive my selenium tests. I'd like to be able to get a screenshot taken automatically when a test fails. This should be supported as explained at http://www.phpunit.de/manual/current/en/selenium.html#selenium.seleniumtestcase.examples.WebTest2.php class WebTest { protected $captureScreenshotOnFailure = t...

How do you connect remotely using Python + Webdriver

Hello, I am trying to figure out how to connect to my remote webdriver instance. This is the code I am currently using: from selenium.remote.webdriver import WebDriver driver = WebDriver("http://172.16.205.129:4444", "firefox", "ANY") driver.get('http://google.com') driver.quit() I find that I can't connect and will get a connectio...

Spawn a multi-threaded Java program from a Windows command line program, spawner won't end until spawnee ends. How can I prevent the hang?

Short version: How can I prevent a spawned Java process in Windows from blocking the spawning process from ending? Long version: I'm trying to spawn a multi-threaded Java program (Selenium RC, not that it should matter) from a program launched from the Windows command line (NAnt's <exec> task, again, not that it should matter). I'm d...

how do i check the value inside a text feild while using ruby selenium testing?

i am running a selenium test using ruby and was wondering how i can assert the value inside a text field? i have a page where once its loaded has text inside the editable text field and i was wondering how i can check if the text is present? thank you ...