Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

When I use a Select tag with an onChange event that causes a prompt Selenium freezes. #3508

Closed
@lukeis

Description

@lukeis

Originally reported on Google Code with ID 3508

What steps will reproduce the problem?

On a page with a select control and an on change event which causes a prompt, when
I use selenium's Select object that causes the prompt, selenium freezes. 

I have tried this on Internet Explorer, and firefox. This worked as expected on Firefox.


What is the expected output? What do you see instead?
I should get control back, but it hangs. 

Selenium version: 2.20
OS: Win XP
Browser: Internet Explorer
Browser version:8.0.6001 


Please provide any additional information below. A sample reduced test
case, or a public URL that demonstrates the problem will intrigue our merry
band of Open Source developers far more than nothing at all: they'll be far
more likely to look at your problem if you make it easy for them!

The select that I use is: (this is a reproduction from something that I found in a
product)
         <select id='selection' onchange="if (this.value == '2') if (!confirm('2?'))
this.value = '1';">
         <option value="1"> 1 </option>
         <option value="2"> 2 </option>
      </select>


Here is a reduced test case that I use 
        @Test
    public void trySomething() { 
        driver.get("http://172.16.206.129/Something.html");
        try { 
            Thread.sleep(3000);
            WebElement elem = driver.findElement(By.id("selection"));
            Select sel = new Select(elem);
            sel.selectByIndex(1);
        } catch(Exception e) { 
        }
    } 

note: the url that I am using in this example is a my local machine.  

Reported by danderson.75 on 2012-03-07 01:38:19

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions