MuraliKola / robotframework-seleniumlibrary

Automatically exported from code.google.com/p/robotframework-seleniumlibrary
Apache License 2.0
1 stars 0 forks source link

`Go To` keyword causes XHR error with Firefox #155

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The 'go to' keyword causes XHR error after upgrading robotframework-selenium 
2.5. This worked fine with robotframework-selenium 2.4. 

When I do this.

go to   ${url}

I get the following error

FAIL XHR ERROR: URL = www.myurls.com/index.html Response_Code = 500 
Error_Message = Internal Server Error 

This is strange because there is no problem with the URL. I did some googling 
and found that if I called the api directly with an extra paramenter true it 
works [http://code.google.com/p/selenium/issues/detail?id=408]. The one below 
works.

Call Selenium API    open    ${url}    ${true}

When I switched back to robotframework-selenium 2.4 it started working agian. 
If you need any log file do let me know the path where I can find them.

Windows XP/Firefox 3.6.10/Python2.7/Jython2.5.1

Original issue reported on code.google.com by sajjadma...@gmail.com on 17 Nov 2010 at 12:06

GoogleCodeExporter commented 8 years ago
Does this happen consistently? 

Original comment by janne.t....@gmail.com on 17 Nov 2010 at 1:25

GoogleCodeExporter commented 8 years ago
Yes, it is consistent. I had other open commands in my testcase and all of them 
stopped working with RF-Sel 2.5. 

Here is the script

Start
Open Browser    ${same url}  # this works
do stuff
go to   ${same url}          # fails with XHR error
go to   ${other url}         # also fails with XHR error

Original comment by sajjadma...@gmail.com on 17 Nov 2010 at 2:52

GoogleCodeExporter commented 8 years ago
Are you using Firefox? Which version? We run all the acceptance tests with Fx 
3.6 on XP, Win7, and Linux without problems.

Based on the description the problem is caused by us updating Selenium's Python 
API (issue 131) and forgetting to incorporate all the custom fixes we had in 
the previous version. I probably fixed this in revision e7ac13716. Could you 
sajjadmalang do the same fix in your local installation (or checkout the latest 
source code) to verify does it fix your problem?

Original comment by pekka.klarck on 17 Nov 2010 at 8:19

GoogleCodeExporter commented 8 years ago
it really is revision 5e7ac13716 :)

Original comment by spielman...@googlemail.com on 17 Nov 2010 at 9:12

GoogleCodeExporter commented 8 years ago
I only modified /src/SeleniumLibrary/__init__.py and ran it but got the error 

TypeError: open() got an unexpected keyword argument 'ignoreResponseCode'   

I think I have to download all the latest sources. But I cannot do this right 
now. I will get back asap.

Thanks.

Original comment by sajjadma...@gmail.com on 18 Nov 2010 at 11:52

GoogleCodeExporter commented 8 years ago
You should change line 341 that originally contains

    self._selenium.open(url)

to

    self._selenium.open(url, ignoreResponseCode=True)

If that really causes the above TypeError, then the actual problem may be 
caused by something else. Could it be that a wrong version of selenium.py 
module is imported? Could you add line

    print 'Selenium location:', selenium.__file__

into the beginning of the __init__.py after line

    from selenium import selenium

and tell what path gets printed?

Original comment by pekka.klarck on 18 Nov 2010 at 12:28

GoogleCodeExporter commented 8 years ago
Sorry for my very slow response but im very new to python but I had problems 
getting my changes compiled and into the python installation. 

The fix still does not resolved the problem I reported.

I manged to make the changes and get it installed. I opened 
C:\Python27\Lib\site-packages\SeleniumLibrary\__init__.py to confirm that the 
line with "ignoreResponseCode=True" is there. Then I ran my tests and got the 
same XHR error back.

My guess is that the fix is not sending the "true" flag to the open command. I 
know this because I can see in the "Command History" box in the browser that 
the open command is still being called as "open(http://myurl.com/indexPage.do, 
False)"

My setup is Windows XP sp3/Firefox 3.6.10/Python2.7/Jython2.5.1

I again appologise for the very very late reply.

Sorry Regards,
\Sajjad.

Original comment by sajjadma...@gmail.com on 29 Nov 2010 at 11:54

GoogleCodeExporter commented 8 years ago
Have the same with Internet Explorer.

Original comment by doc...@gmail.com on 29 Nov 2010 at 1:22

GoogleCodeExporter commented 8 years ago
Forogot to add: For me it happens for certain sites, but earlier, when using 
"Open Browser"

Original comment by doc...@gmail.com on 29 Nov 2010 at 1:29

GoogleCodeExporter commented 8 years ago
I did some digging arround solved the problem.

I did the same fix as mentioned by Pekka in the file browser.py line #24 also. 
Now it works.

<<        self._selenium.open(url)
becomes
>>        self._selenium.open(url, ignoreResponseCode=True)

The resolution is that the patch must be done at two places.

ps: Thanks again for the wonderful tool and the support.

Warm Regards,
\Sajjad.

Original comment by sajjadma...@gmail.com on 29 Nov 2010 at 2:54

GoogleCodeExporter commented 8 years ago
I hadn't noticed that also `Go To` keyword itself uses self._selenium.open. 
Good catch Sajjad!

It's really weird this problem only happens in some cases. Needs to be fixed in 
the next release anyway.

Original comment by pekka.klarck on 9 Dec 2010 at 11:11

GoogleCodeExporter commented 8 years ago
This issue was updated by revision e6866dc210.

Original comment by janne.t....@gmail.com on 3 Jan 2011 at 8:53

GoogleCodeExporter commented 8 years ago

Original comment by pekka.klarck on 4 Jan 2011 at 10:49