0

I am trying to access web elements in a child window in IE8 browser.

I am not able to access any of the element in that child window, I tried Developer tools (F12) in browser, macros to get X path, page source to get ID/name for the elements but nothing is working there. Could some one help me please

BludShot
  • 301
  • 1
  • 3
  • 16
Satya
  • 1
  • 2
  • Do you mean your browser opens up another window and trying to access elements from that window? Did you try switching windows in selenium? – nitin chawda Mar 17 '15 at 07:26
  • you will have to switch to that window using driver.switchTo().window(nameOrHandle) – Mrunal Gosar Mar 17 '15 at 09:01
  • I able to switch to child window ....since my application works only in IE8 i need a way to get ID,Name,xpath of elements.....All the tools i have working for parent to get the ID,Name .....they are not working for child window... – Satya Mar 18 '15 at 05:00

2 Answers2

0

Check the code in the answer provided for a similar question -

Java: focus is not on pop-window during window handling

EDIT: Other approaches-- Try the following steps (Manually):

  1. Open main page, hit F12 to open developer toolbar.
  2. Perform action that opens the popup.
  3. Focus on popup and hit F12. You should see a developer toolbar.

Check this screenshot - http://snag.gy/pPXLX.jpg

As an alternative you may also try getting the URL of the popup and open in a new tab in the main browser window and then do F12 to inspect any elements.

Community
  • 1
  • 1
DRVaya
  • 443
  • 4
  • 13
  • we have a pop up which opens only in IE8...pop up handling in IE8..and i am not able to get any of the value from the pop up...please tell me a way to get the ID,Name,X Path for the elements in the Pop up window. ...F12 is not working for the pop up – Satya Mar 17 '15 at 11:37
  • Do you mean to say you are not able to get anything (ID,Name, etc) on the "Actual Browser" or in "Selenium? – DRVaya Mar 17 '15 at 11:47
  • Yes ....i am not able to get ID,Name of web elements in the actual browser (IE8) ....I need a way to access those elements in that POP Up window ....and I dont have problem accessing the Parent window ... the child window is the problem... – Satya Mar 18 '15 at 04:57
  • I tried both the approaches ...F12 is not at all working in POP up window and URL is not available for the pop up window.... – Satya Mar 18 '15 at 13:11
  • Can you post a snapshot if possible ? – DRVaya Mar 18 '15 at 13:12
  • Just another thought, why dont you try with a User agent in Firefox or Chrome to investigate the issue. – DRVaya Mar 18 '15 at 13:29
  • Hi dharam... please find the screenshot in link........ http://snag.gy/uv5OH.jpg – Satya Mar 19 '15 at 17:19
  • Screenshot doesn't really help here, can you try with User Agent in Chrome to replicate this. – DRVaya Mar 19 '15 at 17:33
  • Tried with user agents in Chrome and firefox its not working in both the browsers..... – Satya Mar 20 '15 at 06:28
0

What do you mean by :-

nothing is working there?

Be specific.

You can open the website in Firefox or some other advanced web-browser to get the element's selectors and later run the automated scripts using IE 8 driver.

BludShot
  • 301
  • 1
  • 3
  • 16
  • The application which i am automating opens only in IE8 it does not work in Firefox,Chrome....I trying access " order number " in the text box.....My problem i am not able to get the ID,Name,xpath of the order number since its works only in IE8..... – Satya Mar 18 '15 at 04:49
  • Developer Tools F12 is not working....and i have macro that read Xpath,ID,Name for IE browser....that is also not working to read the data from that Pop Up window...And i tried getPageSorce() method ......i am getting javascript for that pop up window..... – Satya Mar 18 '15 at 04:51