You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
1. "Maximise browser Window" keyword not working in IE,FF and chrome.I am using selenium2Library.Could you please help me in resolving the issue. #123
I too was getting the same issue with "Maximise browser window" keyword when i used Selenium2library in ROBOT framework.
The "Maximise browser window" keyword is not maximizing the Firefox browser window.
Thanks emanlove. Now it is working very fine. The Fix u suggested is working fine for me.
The "Maximise browser window" keyword is now properly maximizing the Firefox browser window.
just to help others i am mentioning the Steps I followed to fix the issue.
step1: when selenium2library is installed in robot frame work , the selenium2library will create the python files (these python files contains the python code for selenium keywords) in the path "C:\Python27\Lib\site-packages\Selenium2Library\keywords"
step2: Among these python files the code for keyword "Maximise browser window" is present in the python file with name "_browsermanagement.py"
step3: We can find the below code(method) for the keyword "Maximise browser window" in "_browsermanagement.py" file. this code is not working. This code is not actually maximizing the firefox browser window.
def maximize_browser_window(self):
"""Maximizes current browser window."""
self._current_browser().execute_script(
"if (window.screen) { window.moveTo(0, 0); window.resizeTo(window.screen.availWidth, window.screen.availHeight); }")
step4: copy the above file and save it with another name for backup sake. This will help us if we need to revert back quickly incase of any issues.
step5: Now replace the above mentioned code in the "_browsermanagement.py" file with the following code.
def maximize_browser_window(self):
"""Maximizes current browser window."""
self._current_browser().maximize_window()
step5: Save the file "_browsermanagement.py" after editing. Note: make sure u r saving the file in proper encoding technique. I used only "notepad" which comes as deafult with windows to edit and save the file, as i got encoding problem when i edit and saved the file with notepad++. so please double check once before editing and saving. if u face any issues. get back the same file from the back up file we saved.
step6: Now u can perform the same operation what ur doing using the keyword "Maximise browser window". This works fine now.
I am on selenium2library 1.8.0. I am still facing issue with maximize window on chrome / firefox on mac.
Do we have to change the "browsermanagement.py" or is there any other work around to fix this?
When you are reporting an error, it would be a good idea to also tell what error you get. Also, Selenium2Library is not going to be developed further. If the problem still occurs with the latest SeleniumLibrary, you can open a new issue.
Sorry @pekkaklarck, i am new to this. Since my problem was basic thread subject ""Maximise browser Window" keyword not working in chrome.I am using selenium2Library.Could you please help me in resolving the issue." , i thought i can just add a comment.
I am on python 2.7 --> selenium2library ==3.0.0. Using "Maximize Browser Window" command for chrome. The chrome browser does resize, but is not fullscreen. Since the browser does not maximize, i see a tablet view of site instead of desktop view.
Let me know if i have to add any additional detail.
Selenium and SeleniumLibrary are two different packages. If you give command pip freeze you should see the Selenium version and latest should be 3.11.0. But I think easiest way to find where the problem is to you to run the following script:
import time
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://github.com/robotframework/SeleniumLibrary')
driver.maximize_window()
time.sleep(5)
driver.quit()
Save the script in a foobar.py and run it from command line. When running, if you result are the same as with SeleniumLibrary, then the problem is in with Selenium and not with SeleniumLibrary. In this case please raise an issue to the Selenium issue tracker: https://github.com/SeleniumHQ/selenium/issues
Thank you @aaltat. I verified the selenium. i have selenium==3.11.0. I see same issue with on running the test as mentioned above. I will create an issue in the selenium tracker. Thanks for the help.
On Tue, Apr 17, 2018 at 9:20 AM, Pekka Klärck ***@***.***> wrote:
When you are reporting an error, it would be a good idea to also tell what
error you get. Also, Selenium2Library is not going to be developed further.
If the problem still occurs with the latest SeleniumLibrary, you can open a
new issue.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#123 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAoXc7HNBydaxBf24Zh1bgY-OdRcRsQks5tpfongaJpZM4ALM4o>
.
I also observed "Maximize Browser Window" keyword doesn't work issue on my mac machine. According to my investigation keyword works fine on windows machine but fails on mac machine.
And It seems issue is on selenium side since with above python script also we could observe the same behaviour.
Activity
emanlove commentedon Oct 1, 2012
See #83 for possible fix for this issue.
srib4ufrnd commentedon Oct 4, 2012
I too was getting the same issue with "Maximise browser window" keyword when i used Selenium2library in ROBOT framework.
The "Maximise browser window" keyword is not maximizing the Firefox browser window.
Thanks emanlove. Now it is working very fine. The Fix u suggested is working fine for me.
The "Maximise browser window" keyword is now properly maximizing the Firefox browser window.
just to help others i am mentioning the Steps I followed to fix the issue.
step1: when selenium2library is installed in robot frame work , the selenium2library will create the python files (these python files contains the python code for selenium keywords) in the path "C:\Python27\Lib\site-packages\Selenium2Library\keywords"
step2: Among these python files the code for keyword "Maximise browser window" is present in the python file with name "_browsermanagement.py"
step3: We can find the below code(method) for the keyword "Maximise browser window" in "_browsermanagement.py" file. this code is not working. This code is not actually maximizing the firefox browser window.
def maximize_browser_window(self):
"""Maximizes current browser window."""
self._current_browser().execute_script(
"if (window.screen) { window.moveTo(0, 0); window.resizeTo(window.screen.availWidth, window.screen.availHeight); }")
step4: copy the above file and save it with another name for backup sake. This will help us if we need to revert back quickly incase of any issues.
step5: Now replace the above mentioned code in the "_browsermanagement.py" file with the following code.
def maximize_browser_window(self):
"""Maximizes current browser window."""
self._current_browser().maximize_window()
step5: Save the file "_browsermanagement.py" after editing. Note: make sure u r saving the file in proper encoding technique. I used only "notepad" which comes as deafult with windows to edit and save the file, as i got encoding problem when i edit and saved the file with notepad++. so please double check once before editing and saving. if u face any issues. get back the same file from the back up file we saved.
step6: Now u can perform the same operation what ur doing using the keyword "Maximise browser window". This works fine now.
PriyaAn commentedon Oct 8, 2012
Thanks " srib4ufrnd" for taking out your valuable time and explaining it so well...It solved my problem.
emanlove commentedon Dec 11, 2012
Fixed under Selenium2Library Version 1.1
mithunsureshqa commentedon Apr 17, 2018
I am on selenium2library 1.8.0. I am still facing issue with maximize window on chrome / firefox on mac.
Do we have to change the "browsermanagement.py" or is there any other work around to fix this?
pekkaklarck commentedon Apr 17, 2018
When you are reporting an error, it would be a good idea to also tell what error you get. Also, Selenium2Library is not going to be developed further. If the problem still occurs with the latest SeleniumLibrary, you can open a new issue.
mithunsureshqa commentedon Apr 17, 2018
Sorry @pekkaklarck, i am new to this. Since my problem was basic thread subject ""Maximise browser Window" keyword not working in chrome.I am using selenium2Library.Could you please help me in resolving the issue." , i thought i can just add a comment.
I am on python 2.7 --> selenium2library ==3.0.0. Using "Maximize Browser Window" command for chrome. The chrome browser does resize, but is not fullscreen. Since the browser does not maximize, i see a tablet view of site instead of desktop view.
Let me know if i have to add any additional detail.
aaltat commentedon Apr 17, 2018
Please also make sure that you are running latest version of Selenium and ChromeDriver in your Mac.
mithunsureshqa commentedon Apr 17, 2018
@aaltat i have selenium2library ==3.0.0 [which i hope is the latest, i upgraded today using pip] & chrome driver = 2.37.
https://sites.google.com/a/chromium.org/chromedriver/downloads --> is the latest. i am still facing issues.
aaltat commentedon Apr 17, 2018
Selenium and SeleniumLibrary are two different packages. If you give command
pip freezeyou should see the Selenium version and latest should be 3.11.0. But I think easiest way to find where the problem is to you to run the following script:Save the script in a
foobar.pyand run it from command line. When running, if you result are the same as with SeleniumLibrary, then the problem is in with Selenium and not with SeleniumLibrary. In this case please raise an issue to the Selenium issue tracker: https://github.com/SeleniumHQ/selenium/issuesmithunsureshqa commentedon Apr 17, 2018
Thank you @aaltat. I verified the selenium. i have selenium==3.11.0. I see same issue with on running the test as mentioned above. I will create an issue in the selenium tracker. Thanks for the help.
rubygeek commentedon Apr 18, 2018
gvasanka commentedon Sep 26, 2018
I also observed "Maximize Browser Window" keyword doesn't work issue on my mac machine. According to my investigation keyword works fine on windows machine but fails on mac machine.
And It seems issue is on selenium side since with above python script also we could observe the same behaviour.