简体   繁体   English

硒不触发IE中的Onchange,并且不允许页面回发

[英]Selenium not firing Onchange in IE and not allowing page to Postback

I have a web Application, where Once we select a drop down list the other one get loaded. 我有一个Web应用程序,在其中选择了一个下拉列表后,其他应用程序就会被加载。 Here with selenium once the drop down is selected, the page post back gets stopped and the second drop down does not get loaded. 一旦选择了下拉菜单,这里就是硒元素,页面回发将停止并且第二个下拉菜单不会被加载。 I have used the following codes. 我使用了以下代码。 I even tried triggering the on onchange event. 我什至尝试触发on onchange事件。

WebElement selectElement = driver.findElement(By.name("ctrlFundTransfer$dropDownListWrittingCompany"));

String change=selectElement.getAttribute("onchange");

System.out.println("List Item " + change);

Select selectw = new Select(selectElement);

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("alert(\"Executing\");"+change+";");

Kindly tell how to go about that page postback process for loading the second drop down as Selenium i preventing the page postback. 请告诉我们如何进行页面回发过程以加载第二个下拉列表,因为Selenium i可以防止页面回发。

The issue was with GZIP compression. 问题在于GZIP压缩。 You may disable it and work. 您可以禁用它并工作。

http://forums.asp.net/t/1537438.aspx?Disable+GZip+compression+on+a+single+page http://forums.asp.net/t/1537438.aspx?Disable+GZip+compression+on+a+single+page

When in IE if I goto 'Tools', 'Internet Options', 'Advanced', then under 'HTTP 1.1 settings' uncheck both settings and run the page, it works. 在IE中,如果我转到“工具”,“ Internet选项”,“高级”,则在“ HTTP 1.1设置”下取消选中这两个设置并运行页面,即可正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM