Posted By

jerryvig on 09/03/11


Tagged

java Firefox ebay selenium


Versions (?)

Log Into ebay Mobile Website with Selenium RC in Java


 / Published in: Java
 

This is a snippet for logging into ebay's mobile website using firefox and Selenium RC in Java.

  1. import com.thoughtworks.selenium.DefaultSelenium;
  2. import com.thoughtworks.selenium.SeleniumException;
  3. import java.io.IOException;
  4. import java.io.BufferedWriter;
  5. import java.io.FileWriter;
  6.  
  7. public class EbayMobile {
  8. public static void main( String[] args ) {
  9. try {
  10.  
  11. BufferedWriter myWriter = new BufferedWriter( new FileWriter( "./Manta.csv" ) );
  12.  
  13. DefaultSelenium selena = new DefaultSelenium( "localhost",4444,"*firefox","https://m.ebay.com/Login.aspx");
  14. selena.start();
  15.  
  16. selena.open( "https://m.ebay.com/Login.aspx" );
  17. selena.type( "//input[@name='uid']", "myuserid" );
  18. selena.type( "//input[@name='upw']", "mypassword" );
  19. selena.click( "//input[@name='btnSubmit']" );
  20.  
  21. myWriter.close();
  22.  
  23. }
  24. catch ( Exception e ) { e.printStackTrace(); }
  25. }
  26. }

Report this snippet  

You need to login to post a comment.