History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-423
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Andras Hatvani
Reporter: Oleksii Zozulenko
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

Under java client driver testrunner not execute javascript events

Created: 11/Feb/08 11:15 AM   Updated: 24/Aug/08 07:03 PM
Component/s: Client Driver - Java
Affects Version/s: 0.9.0
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. File popup.rar (1 kb)
2. Zip Archive PopUpTest.zip (0.4 kb)

Image Attachments:

1. BugScreen.PNG
(112 kb)
Environment: IE7, FF2, Windows XP, Linux OpenSuse 10.3


 Description  « Hide
Work with java client driver selenium not execute javascript events.

Steps to reproduse:
1. Create html page with code:
[code=html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>
Untitle
</title>

<link href="style.css" rel="stylesheet" type="text/css">
<script src="console.js" language="javascript" type="text/javascript"></script>



</head>
<body>
<form id="form" name="form" style="display:inline;">
<input type="hidden" id="actionName" name="actionName" value=""/>
<input type="button" onclick=" showpopuppage(); " value="Start"/>
</form>

<!-- popup b -->
<div id="divcontainer" class="messagediv">
</div>
<div id="divContent" class="messageDivContent">
<input type="hidden" id="refreshAfterClose" value="false">
<input type="button" value="Close" onClick="closepopuppage();"/>
</div>
<!-- popup e -->
</body>

</html>
[/code]

2. Create javasript file
[code = js]
// JavaScript Document

function showpopup(div_id){
var tp = document.getElementById(div_id);
tp.style.visibility = tp.style.visibility=='visible'?'hidden':'visible';

}
function showpopuppage(){

var overpage = document.getElementById('divcontainer');
var divContent = document.getElementById('divContent');
var docwidth = 0;
var docheight = 0;
var popupwidth = 800;
var popupheight = 600;
var toppos = 0;
  
      document.getElementById("divcontainer").style.backgroundColor = "#FF00FF";
    
// setting popup top / left
divContent.style.top = 100;
divContent.style.left = 100;

// setting popup header width / height
divContent.style.width = popupwidth;
divContent.style.height = popupheight;

// Showing popup
overpage.style.display = "block";
//container.style.display = "block";
divContent.style.display = "block";
divContent.style.background = "#CC99CC";
}

function closepopuppage(fromInnerCloseButton){

var overpage = window.top.document.getElementById('divcontainer');

var divContent = window.top.document.getElementById('divContent');

divContent.style.display = "none";

overpage.style.display = "none";

}


[/code]

3. Create CSS file
[code=CSS]
/* CSS Document */

body {
margin: 0px;
background-color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
font-size: 9pt;
color: #333333;
}


.messagediv{
width: 100%;
height: 100%;
display: none;
position:absolute;
top: 0px;
left: 0px;
background: transparent;

opacity: 9.99;
visibility: hidden;
}


.messageDivContent {
position: absolute;
display: none;
}

[/code]

4. Create TestCase file
[code=java]
package test;

import com.thoughtworks.selenium.*;
import junit.framework.*;
public class PopUpTest extends TestCase {
    private Selenium browser;
    public void setUp() {
        browser = new DefaultSelenium("localhost",
            4444, "*iexplore", "http://localhost");
        browser.start();
    }
    
    public void testGoogle() {
        browser.open("/popup/index.html");

        browser.click("//input[@value='Start']");
        browser.click("//input[@value='Close']");
    }
    
    public void tearDown() {
      // browser.stop();
    }
}
[/code]

5. Run selenium server
6. Execute TestCase file

Result: PopUp not close and javascript log about error on page




 All   Comments   Work Log   Change History      Sort Order:
Oleksii Zozulenko - 11/Feb/08 11:18 AM
Add source files

Oleksii Zozulenko - 11/Feb/08 11:19 AM
TestCase java file
PS (You need JUnit)

Oleksii Zozulenko - 11/Feb/08 11:22 AM
Screen Bug

Andras Hatvani - 24/Aug/08 07:03 PM
Do you experience the same behavior with SRC 0.9.2?