- hresgil
- Posts : 5
Join date : 2011-12-20
Issues with IE close browser, Firefox window focus. unable to get screenshots any browser
Tue Dec 20, 2011 8:58 pm
Hi, my name is Hernan,
I'm trying to build a test suit and after investigating about the proper tool to use, I came across to selenium.
But I have found the following problems, that if not resolved then I may need to start all over again looking for a different automation tool.
1 Can't get screenshots with selenium 2.13 and 2.15 on any browser.
2. I have tried to maximize the Firefox browser in many ways, but I never succeed.
3. There is no way I can get focus on Firefox, so I can’t maximize it using JRobot.
4. Finally, on internet Explorer I always get error when closing selenium (selenium.close and selenium.stop commands) and the browser does not close. Then other tests that follow cannot be continued until closing the browser manually.
Could anyone help please?
Note I'm using IE8 and Firefox 8.0.1 (windows XP and Windows Vista)
I'm trying to build a test suit and after investigating about the proper tool to use, I came across to selenium.
But I have found the following problems, that if not resolved then I may need to start all over again looking for a different automation tool.
1 Can't get screenshots with selenium 2.13 and 2.15 on any browser.
2. I have tried to maximize the Firefox browser in many ways, but I never succeed.
3. There is no way I can get focus on Firefox, so I can’t maximize it using JRobot.
4. Finally, on internet Explorer I always get error when closing selenium (selenium.close and selenium.stop commands) and the browser does not close. Then other tests that follow cannot be continued until closing the browser manually.
Could anyone help please?
Note I'm using IE8 and Firefox 8.0.1 (windows XP and Windows Vista)
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser
Wed Dec 21, 2011 3:09 pm
There is a command in Selenium to maximize window:
If you want to close browser, try this:
- Code:
selenium.windowMaximize();
- Code:
selenium.getEval("window.resizeTo(X, Y); window.moveTo(0,0);");
If you want to close browser, try this:
- Code:
selenium.getEval("window.close");
- hresgil
- Posts : 5
Join date : 2011-12-20
Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser
Thu Dec 22, 2011 4:52 am
Thanks for your reply,
I have tried these suggestions, but neither one seem to work, could you please provide a working example?
I have tried these suggestions, but neither one seem to work, could you please provide a working example?
- hresgil
- Posts : 5
Join date : 2011-12-20
Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser
Mon Dec 26, 2011 9:05 pm
Hi,
I managed to maximize Firefox browser with the java script code as suggested by faramka.
But unfortunately the program (eclipse) used to launch selenium RC, remains at the front and I have been unable to bring the main browser to the front of the screen.
I have tried 'selenium.windowFocus' and
selenium.getEval("wondow.focus"); but neither works.
I'm still trying to capture screenshots but no luck so far.
Any help would be very much appreciated thanks please?
I managed to maximize Firefox browser with the java script code as suggested by faramka.
- Code:
selenium.getEval("window.resizeTo(screen.availWidth, screen.availHeight); window.moveTo(screen.availWidth, screen.availHeight);");
But unfortunately the program (eclipse) used to launch selenium RC, remains at the front and I have been unable to bring the main browser to the front of the screen.
I have tried 'selenium.windowFocus' and
selenium.getEval("wondow.focus"); but neither works.
I'm still trying to capture screenshots but no luck so far.
Any help would be very much appreciated thanks please?
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser
Tue Dec 27, 2011 2:37 pm
Try use getAllWindowIds() or getAllWindowNames() and then selectWindow(). Read documentation for getting to know these commands.
- jaffarlone
- Posts : 1
Join date : 2012-01-23
Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser
Tue Jan 24, 2012 3:15 pm
Hi, am facing similar problem, tried using getAllWindowIds(), it will print "id isundefined" on the console, my code is like this:
String getwindowid = "";
for(int i=0; i getwindowid = getwindowid + windowids[i];
}
System.out.println("id is" + getwindowid);
String getwindowid = "";
for(int i=0; i
}
System.out.println("id is" + getwindowid);
- Sponsored content
Permissions in this forum:
You cannot reply to topics in this forum