Hi Arihan,
Which language are you using to automate the suite? In Java or .NET,
we cannot pass an extra argument "true". I have fixed this error on my
setup using argument true, but language i am using is Perl which does
accepts another argument.
Now, in .NET or Java, this can be done by encapsulating the open
command in a try catch block, and then parse the exception string to
see if its having XHR error, if yes, then just ignore and continue, if
some other error you may like to terminate your test there.
Pseudo code will look like this:
try {
selenium.open("/URL_TO_BE_OPENED");
}
catch (Exception e) {
if(e.contains("XHR"); //I am not a pure Java guy, sorry !!
{
##Just log the error in log file and do nothing
}else {
Exit;
}
}
Hope it helps.
Thanks
Rajat Jindal
http://www.quicksilver1183.com
On Sep 17, 10:56 pm, arihan sinha <
arihan.si...@gmail.com> wrote:
> Hi Sanjeev/Dheeraj,
>
> Sanjeev,
>
> As per your suggestion It seems the page navigation first goes to
> /Account/LogOnWhich and it retrieves to the 404 error code always.
> Hence it would come to the main base urlwww.mflow.comas per resuce part as
> page.open "/" which again would give the 404 error code because when the
> home page gets requested , the Account/logOnwhich request goes underneath
> which retrieves always 404 code. so test would get terminated. If you have
> tried at your end then please let me know
>
> Dheeraj,
>
> As per your code , you have given extra argument as "true" but I guess open
> method accepts only one argument. So did you override the open method or
> what??. As I tried and it gives wrong argument nos. ( 2 for 1)
>
> sel.open(*"/admin"*,*"true"*)
>
> Cheers
> A
>
> sel.open(*"/admin"*,*"true"*)
>
> On Wed, Sep 15, 2010 at 10:23 AM, sanjeev mathur <
learnsanj...@gmail.com>wrote:
>
>
>
> > Try this
>
> > it "Renders correctely" do
>
> > begin
> > page.open "/Account/LogOnwhich"
> > raise "Page 404 not found" if @selenium_driver.is_element_present
> > "//div[@id='content']/div/fieldset/h2" == true
> > rescue
> > puts "An error occured #{$!}"
> > page.open "/"
>
> > end
> > page.is_text_present("DDN Ltd 2010 All rights reserved.").should
> > be_true
>
> > end
>
> > On Wed, Sep 15, 2010 at 1:45 PM, Arihan <
arihan.si...@gmail.com> wrote:
>
> >> Any workaround to this pls ..
>
> >> Regards
> >> Arihan
> >> Sent from my iPhone
>
> >> On 14 Sep 2010, at 17:13, arihan sinha <
arihan.si...@gmail.com> wrote:
>
> >> I am using selenium+ruby+rspec and below is code which i am using . could
> >> you please let me know where i would put this @Test(skipFailedInvocations =
> >> true)
>
> >> require "rubygems"
> >> gem "rspec"
> >> gem "selenium-client"
> >> require "selenium/client"
> >> require "selenium/rspec/spec_helper"
>
> >> describe "When I go to the HomPage" do
> >> attr_reader :selenium_driver
> >> alias :page :selenium_driver
>
> >> before(:all) do
> >> @verification_errors = []
> >> @selenium_driver = Selenium::Client::Driver.new \
> >> :host => "localhost",
> >> :port => 4444,
> >> :browser => "*googlechrome",
> >> :url => " <
http://www.mflow.com>
http://www.mflow.com",
> >> :timeout_in_second => 240
>
> >> end
>
> >> before(:each) do
> >> @selenium_driver.start_new_browser_session
> >> end
>
> >> append_after(:each) do
> >> @selenium_driver.close_current_browser_session
> >> @verification_errors.should == []
> >> end
>
> >> it "Renders correctely" do
>
> >> begin
> >> page.open "/"
> >> rescue
> >> page.wait_for_page_to_load "30000"
> >> end
> >> page.is_text_present("DDN Ltd 2010 All rights reserved.").should
> >> be_true
>
> >> end
>
> >> end
>
> >> On Tue, Sep 14, 2010 at 4:47 PM, pinglin < <
ahryts...@gmail.com>
> >>
ahryts...@gmail.com> wrote:
>
> >>> try @Test(skipFailedInvocations = true)
>
> >>> On Sep 14, 1:20 pm, arihan sinha <
arihan.si...@gmail.com> wrote:
> >>> > I know one solution which would move run my test like as below
> >>> > begin
> >>> > page.open "/mflow.public/"
> >>> > rescue
> >>> > page.wait_for_page_to_load "30000"
> >>> > end
>
> >>> > but I want if any way we can ignore that 404 code for that particualr
> >>> > request
> >>> > as example when we navigate to <
http://thewww.mflow.com>
> >>>
thewww.mflow.com, one rquest goes to thehttp://<
http://www.mflow.com/Account/LogOnwhich>
> >>>
www.mflow.com/Account/LogOnwhichgives 404 error
>
> >>> > any workaround so that this particular request (/Account/Logon) if
> >>> gives 404
> >>> > error then selenium should ignore that or covert that to status code
> >>> 200 or
> >>> > blocking the request for this url(/Account/Logon) to server so that
> >>> test
> >>> > would move forward without giving exception
>
> >>> > Cheers
> >>> > A
>
> >>> > On Tue, Sep 14, 2010 at 10:45 AM, arihan sinha <
arihan.si...@gmail.com
> >>> >wrote:
>
> >>> > > Anyone found any solution for this then pls let me know ??
>
> >>> > > Cheers
> >>> > > A
>
> >>> > > On Mon, Sep 13, 2010 at 6:39 PM, arihan sinha <
> >>>
arihan.si...@gmail.com>wrote:
>
> >>> > >> Dear all
>
> >>> > >> in the webpage i am testing ( <
http://www.mflow.com>
www.mflow.com),
> >>> the page opens fine but in
> >>> > >> the backend one requrest goes to server which retrieves the 404
> >>> error code
> >>> > >> which subsequently terminates the selenium .
> >>> > >> so i am getting the error as
> >>> > >> "XHR ERROR: URL = <
http://www.mflow.com/Response_Code>
> >>>
http://www.mflow.com/Response_Code= 404
> >>> > >> Error_Message = Not Found"
> >>> > >> Any workaround pls at selenium end ( not at the code level by
> >>> developers
> >>> > >> :) )
>
> >>> > >> you can try this by just navigating to the home page thorugh
> >>> selenium (
> >>> > >> <
http://www.mflow.com>
www.mflow.com)
> >>> > >> I am using selenium+Ruby+Rspec
>
> >>> > >> Regards
> >>> > >> Arihan
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Selenium Users" group.
> >>> To post to this group, send email to <
seleniu...@googlegroups.com>
> >>>
seleniu...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> <
selenium-users%2Bunsu...@googlegroups.com>
> >>
selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go
oglegroups.com>
> >> .
> >
selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go
oglegroups.com>
> > .