Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling driver.switchTo().frame causes java.lang.StringIndexOutOfBoundsException #103

Open
Apxdono opened this issue Jul 8, 2014 · 0 comments

Comments

@Apxdono
Copy link

Apxdono commented Jul 8, 2014

When trying to switch to frame using opera driver implementation i constantly get 'java.lang.StringIndexOutOfBoundsException: String index out of range: -1' at 'com.opera.core.systems.scope.stp.services.ScopeEcmascriptService'. The method ' framePathToIndex(String framePath)' tries to extract the index between square brackets from framePath value ( which is usually something like "frameName[index]" ). But sometimes the value, that is passed to this method has no brackets at all which causes the problem.

Code to reproduce:
@test
public void frameTest() {
WebDriver driver = new OperaDriver();
driver.get("http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple");
driver.switchTo().frame("iframeResult");
WebElement we = driver.findElement(By.tagName("select"));
LOG.info(we.getTagName());
LOG.info(we.getAttribute("multiple"));
driver.switchTo().defaultContent();
WebElement body = driver.findElement(By.id("result"));
LOG.info(body.getTagName());
driver.quit();
}

Sys info:
windows 7 x64
opera version: 12.17 build 1863 for x32 platforms (and a couple of older versions)
java 1.7.0_51 x64

selenium-java versions tested 2.37.0 - 2.42.0
opera-driver version 1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant