Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I am using Selenium WebDriver and run into a issue.

In the UI, elements are seen by the WebDriver but couldn't perform any actions such as click, type, select etc. Elements are findby the selenium and returned as instance of webelement. I can get, getText(),isEnabled() etc, but wont perform any actions. There is no exceptions, it just hangs.

I dont understand this behavior. If it seen by the WebDriver, it should click. I have tried using actions. That too shows the same behavior.

How to debug this issue? Any ideas?

Sample code,

driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(Integer.parseInt(Timeout), TimeUnit.SECONDS);
element=driver.findElement(By.id("test"));
element.clear();
element.sendKeys("test");

This works in other websites. Not in the one I'm testing. So I don't know, is there issue in WebDriver or in AUT.

EDIT: After moving to Selenium 2.13.0, above issues resolved. But I still want to know how to debug in case of error.

share|improve this question
1  
Can you post a code snippet to show us how you are using WebDriver? –  Stephen Gross Nov 23 '11 at 18:44
    
The code works in other websites. Any way, I'll put the sample code –  Rajasankar Nov 24 '11 at 0:25
    
Have you got frames/iframes that you haven't switched to? –  Ardesco Feb 7 '12 at 14:25
    
can you do it with debugging tool as used with a normal java program? –  Emmanuel Angelo.R Mar 27 at 5:31
add comment

1 Answer 1

Only way to debug the code is to write wrapper around WebDriverEventListener and listen to the logs. Other wise, it is not possible.

share|improve this answer
    
Here's possible implementation and how to hook the listener into a driver: simon-reekie.me/twist-experiences/… –  dzieciou May 21 at 19:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.