-2

when I switch to other window and I want to edit from text box then the xpath of text box giving no such element exception even xpath is correct

please guide me why I am getting a error

Ankesh
  • 1
  • Please read [ask], especially the part about [mcve] (MCVE), and ["How much research effort is expected?"](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users). This will help you debug your own programs and solve problems for yourself. If you do this and are still stuck, you can come back and post your MCVE, what you tried, and the execution result including any error messages so we can better help you. At a minimum you need to provide the relevant HTML, properly formatted, but additionally a link to the page is usually very helpful. – JeffC Apr 20 '23 at 17:56

1 Answers1

0
Probably, when an application takes you to another window to perform the remaining action so that time selenium control is still vested in the parent window, for that you have to switch to the window first to perform the remaining action. please follow the below line of codes to handle windows.

Set<Integer>Allwindows=driver.getwindowhandles();

for (int windowHandle:Allwindows) 
{
sysout("All windows"+windowHandle.size());
}
//Child window
driver.switchTo().windows(1);
//SwitchBack to Parent
driver.switchTO.windows(0);
}
    
Bhairu
  • 72
  • 4