2

In My case I have Many Frame In The APP Under Test And many popUp So I need Each time To go Into The Popup And return To original Windows : chrome :

ExemplePg.getWindowHandle(); 
driver.switchTo().defaultContent()
driver.switchTo().frame(sylobHomepg.get_FrameLevel2());

FireFox:
I need to add "defaultContent" with:

 ExemplePg.getWindowHandle();
 driver.switchTo().defaultContent();
 driver.switchTo().frame(sylobHomepg.get_FrameLevel2());

Questions:

  1. Why I have this difference between chrome and Firefox??
  2. My job in Jenkins Work Well, many times and sometimes I have an error: No such windows?

Update: With chrome i am using just:

ExemplePg.getWindowHandle(); 
driver.switchTo().defaultContent();
driver.switchTo().frame(sylobHomepg.get_FrameLevel2()); 

Without default and its work and with firefox not I need to add switch default before switch frame.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
user3313418
  • 35
  • 1
  • 8

1 Answers1

0

The relevant HTML would have helped us to analyze the issue in a better way as it is still not clear whether you are dealing with <frame> / <iframe>. Perhaps there is no significant difference between Chrome and Firefox in handling the <frame> / <iframe>.

There is no such necessity to ExemplePg.getWindowHandle(); before switching between <frame> / <iframe> but it is important to:

  • Induce WebDriverWait for the desired frame to be available and switch to it as follows.

    new WebDriverWait(driver, 10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(driver.findElement(sylobHomepg.get_FrameLevel2())));
    

Here you can find a relevant discussion on Is it possible to switch to an element in a frame without using driver.switchTo().frame(“frameName”) in Selenium Webdriver Java?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352