0

I am trying to switch to 4 frames linearly in my application using selenium .I wrote switch to frame through index values.when i execute the test case through eclipse its working good,but when i am trying to run the test case through grid using bat file. test case is failing at fourth frame.....

why it is executing fine through eclipse and why it is not working through grid.

Could any one say the exact reason for this issue and how to resolve it?

Thanks in advance friends...

user3016945
  • 265
  • 1
  • 6
  • 10
  • Please anyone help me how to resolve this issue....I tried with below suggestions,but I am unbleto switch to frame Thanks in advance friends – user3016945 Dec 02 '13 at 08:00

1 Answers1

0

Frames are loaded asynchronously. They may not even be loaded in the order you expect. You have to wait for each to be loaded before switching to it. (Timing may be slightly different in development and test environment.) If you use WebDriver (Selenium 2), then have a look at How do i wait for a specific frame to load? I'm using selenium webdriver 2.24. In Selenium 1, due to weak support for frames, you might need to use fixed pauses (or try catch retry).

In a frame hierarchy, some browsers may offer dummy frame contents which do not have the expected content (especially sub-frames) before loading the real content commences. I.e. switching to such a frame to early takes you into a dead end. (Take this into account if you use the try-catch-retry approach mentioned above.)

Community
  • 1
  • 1
halfbit
  • 3,414
  • 1
  • 20
  • 26
  • Thanks for your reply,I am using selenium webdriver and I am giving Waittime 50 seconds between each frame. I am not getting any issues when i am running through Eclipse,I am getting when I am running through grid.... could please give me beeter idea to resolve this please – user3016945 Nov 25 '13 at 11:52
  • I do not have an idea what could be wrong then. Next thing I would try is catch the exception and capture a screenshot if this is possible for you - and verify expectations visually. (For example code see http://stackoverflow.com/questions/3422262/take-a-screenshot-using-selenium-webdriver-with-java. You may have to switch to the top window to be able to take a screenshot.) – halfbit Nov 25 '13 at 15:04
  • I do not have an idea what could be wrong then. Next thing I would try is catch the exception and capture a screenshot if this is possible for you - and verify expectations visually. (For example code see http://stackoverflow.com/questions/3422262/take-a-screenshot-using-selenium-webdriver-with-java. You may have to switch to the top window to be able to take a screenshot.) – halfbit Nov 25 '13 at 15:05
  • I tried by using try and catch block i am getting not able find frame Exception...I am switching to frames index value 0 becoz thos frames doesn't have id or names...I am using old server 2.24 is this is problem? where should i know the release notes of new updated server for grid – user3016945 Nov 25 '13 at 16:24
  • I did not find release notes either. Did you try to capture a screenshot - or can you verify that everything is displayed as expected during grid test in another way? – halfbit Nov 25 '13 at 20:39
  • yeah I see that screen shot page is completely loaded but not able switch to frame by keepimg waittime mor also no luck. – user3016945 Nov 26 '13 at 06:12