Finding number of frames, returns = 2
int size = SF.findElements(By.tagName("iframe")).size();
System.out.println("Total frames present - " + size);
then trying to click the element assuming in frames either 1 or 2
System.out.println("Clicked on bulb"); //after clicking this element then opens up a new browser - problem starts here
Thread.sleep(7000);
SF.switchTo().frame(1);
SF.findElement(By.xpath("//input[@id= 'lksrch']")).sendKeys("chehalis"); // FAILS to find the element embedded inside the frame
Tried by inputting frame numbers in different combo's 0,1 and 2 and none of them is successful
Webdriver returns an error "No such frame"
you have switch to frame 1 and then switch to default frame and then switch to frame 2.
Hi Ashish,
Due to some project delays, i kept my selenium project in limbo and now again, it's time to get the hands dirty.
For above question, tried different solutions with switching windows but couldn't able to manage to make webdriver to [b:2b892ata]move[/b:2b892ata] to new window.
Would you mind have another look if you have time ?
Update:
Good news is I can switch to the new window opened. ( confirmed by maximizing the new window)
Bad news is [b:1njr172v]I cannot find any element in the new window[/b:1njr172v] - I made sure my xpath is correct and no spelling mistakes ( also used wait statements to ensure webdriver has enough time to find out the element)
help ?