webdriver

Best way to take screenshots of tests in Selenium 2?

So I need a way to take screenshots of my functional tests. Right now I'm using Selenium 2 with C# bindings. I pretty much want to take a screenshot at the end of the test to make sure the desired page is displayed. Are there any particular tools you guys know of that I can incorporate into my C# code that will trigger a screenshot? I co...

Selenium 2 + firefox getting System.NotSupportedException

Hi, I am trying out WebDriverBacked selenium. I used the below code. But, it gives me "System.NotSupportedException : command" exception. IWebDriver driver= new FirefoxDriver(); Selenium.WebDriverBackedSelenium selenium= new WebDriverBackedSelenium(driver,myUrl); selenium.Type(locator,value); Here the command gets replaced by any sele...

Using C# to simulate confirming a javascript popup

So I'm trying to verify the pop-ups occur in my Selenium 2 functional tests. Right now there seems to be no built-in way for selenium 2 to handle these. Is there a way to create C# code that will notice an alert, and simulate hitting the "Enter" key? ...

java.lang.ClassNotFoundException: WebDriver API

I downloaded the selenium-java-2.0a5.zip http://code.google.com/p/selenium/downloads/list and ran the following code: package org.openqa.selenium.example; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.htmlunit.HtmlUnitDriver; public class Examp...

webdriver API: how to disable verbose error messages ?

Running the example source at http://code.google.com/p/selenium/wiki/GettingStarted It runs successfully, however Eclipse throws bunch of WARNING messages. How Can I disable this from displaying ? All I really need is the last line "Page title is: Cheese! - Google Search" 17-Aug-2010 12:07:00 AM com.gargoylesoftware.htmlunit.util.Stri...

watir-webdriver wait for page load

using watir-webdriver [ http://github.com/jarib/watir-webdriver ] how do i wait for a page to load after i click a link? at the moment i am doing sleep n but this is not ideal as the page response varies so much. is their a method to test whether the page is ready or whether their is a certain element in the page. I understand in t...

webdriver keeps throwing IOException and reconnecting

I am using webdriver api (Selenium) and when I am trying to test a site (which I can view and browse normally in my browsers), I get the following message over and over. INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect 18-Aug-2010 12:36:08 AM org.apache.commons.httpclient.Http...

Webdriver Xpath Performance

Is there a major difference in the time it takes to evaluate a long xpath than a short xpath? Ex. Is there a performance difference between /div[@id = 'id1']/label[contains(text(), 'Hello')/../../descendant::input and //input What about the difference between using By.id("id1") and By.Xpath("//*[@id='id1']") ...

FirefoxDriver: how to disable javascript,css and make sendKeys type instantly ?

While using FirefoxDriver to write tests, I discovered loading of pages are really slow because of javascript and css being executed. IS there anyway to disable this ? possible to even install Noscript plugin to profile ? additionally, sendKeys(), actually types out the text. however, this is quite slow for long text, anyway to instant...

how to pass new instance of FirefoxDriver to each new thread ?

public class Tester implements Runnable { public Tester() { // Init WebDriver FirefoxProfile firefoxProfile = new FirefoxProfile(); WebDriver browser1 = new FirefoxDriver(firefoxProfile); WebDriver browser2 = new FirefoxDriver(firefoxProfile); } public static void main(String[] args) { ...

Selenium 2 - Switching focus to a frame that has no name/id

So right now I'm trying to figure out how I can switch focus to a frame in Selenium 2 when the frame has no name or id? For a named frame I do: driver.SwitchTo().Frame(FrameName); but what is there is no name? Has anyone had experience with this? ...

Designing an webtesting DSL to be implemented by different Web testing drivers - should we mix primitive and non-primitive operations?

We are implementing a web test automation project for some intranet applications. To easy the writing of each test, we are designing a Java DSL that can be implemented using different adapters (we've chosen Sahi and Selenium/WebDriver so far, as we want to measure them side by side in terms of performance, readability, maintainability,...

Selenium Webdriver - missing classes in maven repository

Hi, I have been using Selenium Webdriver successfully with JAR downloaded from their pages or code.google. But now I would like convert my project to use Maven repository. I found out that my required classes are in support module of webdriver and confirmed it in their repository ( classes Wait, WebDriverWait, ExpectedCondition). So I ...

Cucumber and Capybara, clicking a non-link or button element

I am trying to test an inplace editor using Cucumber/Capybara/Selenium stack, but my problem is that the editor is activated by clicking a div and not a link or button. I can not seem to figure out how to get Capybara to do this. Is there a way of doing this? ...

The get() method times-out although the page is displayed correctly

I'm using Selenium 2 in Java, and when loading a web page using Webdriver's (the InternetExplorerDriver class) get() method a time-out is received and the execution halts although the page appears as completely loaded to me. I've tried using the WebDriverWait class but I can't figure out what function to provide as the condition to the u...

WebDriver dismiss a alert box

how to dismiss a alert box by clicking "OK" button? I saw on WebDriver Google group that Simon is adding this feature. I am not sure whether this is supported or not. ...

Is there a way to detect that I'm in a Selenium Webdriver page from Javascript

I'd like to suppress the initialization of TinyMCE inside my tests and can do this easily if the Javascript can detect that I'm running inside a Selenium-automated page. So, is there some JS code that I can use to detect the Selenium driver? Alternatively, how can I extend the userAgent string to include a pattern that I can detect from...

what's the relationship between selenium rc and webdriver?

I can see that since selenium 2.0, webdriver and selenium rc are packaged together for download. Now I primarily use webdriver, but can I bring in selenium rc in my testing scripts from now and then? Is there anything that selenium rc is capable of but webdriver is not, or vice versa? ...

Is it possible to open a new tab in watir-webdriver?

The only thing that looks a bit like what I'm trying to achieve is this, but this works only for IE... for firefox I found that information, so is it not possible to open tabs, just new windows? And the attach method is accessing only already OPEN tabs/windows... Is there a way to decide to open a specific link in a new window/tab? I se...

Alert box in Waitr Webdriver

I had a look here: http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Every solution is for IE on Windows. I am using Firefox on Mac. Is there a way to click on OK of a JavaScript alert box? ...