How do I get a handle to the UVM factory?

In the second example , as you mentioned , i got the handle by using uvm_factory::get() , but i am still not able to use method find_by_name(). It gives error that " find_by_name is not a class item "

Example :
class base_test extends uvm_test;
`uvm_component_utils(base_test)
uvm_factory factory;


function void build_phase(uvm_phase phase);
super.build_phase(phase);
factory = uvm_factory::get();
endfunction
endclass

class basic_test1 extends base_test;
`uvm_component_utils(basic_test1)

 function void build_phase(uvm_phase phase);
  super.build_phase(phase);
 uvm_config_wrapper::set(this,"vsequencer.main_phase","default_sequence", factory.find_by_name("basic_write_seq"));

 endfunction

endclass