From: asashour <asa...@ya...> - 2015-10-28 09:11:21
|
Hi, - You must subscribe to the list before posting. - The code works locally, but on OpenShift it doesn't. Ahmed Aurasphere wrote > Hello, > I am using SeleniumWebDriver 2.48.2 to fill a form and submitting it. I > did this from my computer and it works perfectly, but when I upload the > app to OpenShift I get a StackOverflowError when I submit the form. Here's > the stacktrace: > > [0m[31m04:29:06,529 ERROR [stderr] (Thread-110) Exception in thread > "Thread-110" java.lang.StackOverflowError > [0m[31m04:29:06,542 ERROR [stderr] (Thread-110) at > net.sourceforge.htmlunit.corejs.javascript.regexp.NativeRegExp.emitREBytecode(NativeRegExp.java:1311) > [0m[31m04:29:06,547 ERROR [stderr] (Thread-110) at > net.sourceforge.htmlunit.corejs.javascript.regexp.NativeRegExp.emitREBytecode(NativeRegExp.java:1281) > [0m[31m04:29:06,547 ERROR [stderr] (Thread-110) at > net.sourceforge.htmlunit.corejs.javascript.regexp.NativeRegExp.emitREBytecode(NativeRegExp.java:1286) > [0m[31m04:29:06,548 ERROR [stderr] (Thread-110) at > net.sourceforge.htmlunit.corejs.javascript.regexp.NativeRegExp.emitREBytecode(NativeRegExp.java:1286) > [0m[31m04:29:06,548 ERROR [stderr] (Thread-110) at > net.sourceforge.htmlunit.corejs.javascript.regexp.NativeRegExp.emitREBytecode(NativeRegExp.java:1286) > [0m[31m04:29:06,564 ERROR [stderr] (Thread-110) at > net.sourceforge.htmlunit.corejs.javascript.regexp.NativeRegExp.emitREBytecode(NativeRegExp.java:1286) > > (he keeps going for a while but all the lines are the same...) > > As you can see from the stacktrace, I am using HtmlUnit WebDriver. I > googled this but I didn't find anybody with my exact problem, although it > seems that HtmlUnit often gives StackOverflow errors... > > Here's my code: > > HtmlUnitDriver driver = new HtmlUnitDriver(BrowserVersion.CHROME); > driver.setJavascriptEnabled(true); > driver.get(myUrl); > //Finds the fields of the login form and fills it. Also removes the > Remember me checkbox. > WebElement email = driver.findElement(By.id("email")); > email.clear(); > email.sendKeys(username); > > WebElement rememberMe = driver.findElement(By.name("persistent")); > if(rememberMe.isSelected())rememberMe.click(); > > WebElement pass = driver.findElement(By.id("pass")); > pass.clear(); > pass.sendKeys(pass); > > //HERE IS WHERE THE ERROR OCCURS: > pass.submit(); > > Instead of submit I've also tried to get the input manually from the > button and click it like this: > > WebElement button = driver.findElement(By.id("u_0_2")); > button.click(); > > but the problem is exactly the same... > > I also tryed with a little workaround: I've started the driver with > javascript disabled and I've been able to submit the form. Then I enabled > it and refreshed the page (I need javascript enabled) and as soon as I run > this line: > > List > <WebElement> > elements = driver.findElements(By.className(className)); > > I get again the same exception... > > From what I understand there's definitely a problem with Javascript but I > don't understand why. > Can anyone tell me if this is a bug or if am I missing something? Any help > is really appreciated, thanks! -- View this message in context: http://htmlunit.10904.n7.nabble.com/HtmlUnit-throws-StackOverFlowError-on-form-submit-tp37594p37595.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |