Hello

 

I’m wishing to check that when an application is launched more than once in a browser, only the first browser instance can login and the second is returned a suitable error page.

 

So far I’ve added this code to a module, to deal with this:

 

            def otherinstance(testname, testpass, testldap)

                        threads = []

                        2.times do threads << Thread.new {login(testname, testpass, testldap)}

               begin

                                    assert(ie.frame("main").contains_text("app_name") )

                                    logger.log("Passed. Found test string 'app_name' ")

                                    logger.log_results("otherinstance", "app_name", "app_name", "TEST PASSED.")

               rescue => e

                                    logger.log("*FAILED*." + e.message + "\n" + e.backtrace.join("\n"))

                                    logger.log_results("otherinstance", "app_name", "app_name", "TEST FAILED.")  

               end

 

currently, I’m just trying this out, so the code is very similar to the Watir examples.

 

My question is how I identify the browser instance? Do I iinitialise an empty count in the otherinstance method and then increment if for each instance created in the block.

 

(Incidentally - the number 2 is not fixed; once I’ve got this code up and running it will be good for x instances of the browser.

 

Thanks

Max

 

 

Max Russell

test Analyst.

InPS

 

Tel: 01382 223900

Fax: 01382 204488

 

Visit our Web site at www.inps.co.uk

 

The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact [EMAIL PROTECTED]

 

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to