Windows 7 32 on Selenium 2+sikuli resolve swfupload type upload Plugin

Source: Internet
Author: User
Tags sikuli

  1. Install Sikuli, after installation is complete, install directory in C:\Program files, copy the installation files to the C drive

  2. Configuring Environment variables

  3. Install Eclipse and add the Selenium Java version of the jar package to the project you are using

  4. There is a sikuli_script.jar under Sikuli-ide, add it to the project you are using

  5. In the program to add the user picture saved directory, this is very important, otherwise you will be prompted to not find the picture

  6. Specific procedures are as follows


  7. package com.client.pmj;import java.util.concurrent.timeunit;import  org.apache.commons.jxpath.ri.compiler.path;import  Org.jboss.netty.handler.codec.frame.lengthfieldbasedframedecoder;import org.openqa.selenium.*;import  org.openqa.selenium.WebDriver.*;import org.openqa.selenium.firefox.*;import  Org.openqa.selenium.lift.find.imagefinder;import org.python.antlr.pythonparser.if_stmt_return;import  org.python.modules.thread.thread;import org.sikuli.script.*;p ublic class client { Public static void main (String[] args)  {system.out.println ("HelloWorld"); System.out.println ("hello world!"); Webdriver driver = new firefoxdriver (); string base_url =  "http://www.cxxxxn.com/";d river.get (base_url+ "sign_in");d river.manage (). Window (). Maximize ();d river.findelement (By.id ("Mail")). Clear ();d river.findelement (By.id ("Mail")). SendKeys (" Account ");d river.findelement (by.id (" pwd ")). CLEAR ();d river.findelement (by.id ("pwd")). SendKeys ("password"); Try {thread.sleep (3000);}  catch  (interruptedexception e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();} Driver.findelement (By.cssselector ("Button.btn-grey.btn-regular")). Click (); Try {thread.sleep (3000);}  catch  (interruptedexception e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();} Webelement step_1 = driver.findelement (By.id ("submenu")). Findelement (By.tagName ("a")); step_1. Click (); Try {thread.sleep (3000);}  catch  (interruptedexception e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();} Test Flash Upload Plugin module imagelocator  p = new imagelocator (); String[] path = p.getimagepath (); Imagelocator.addimagepath ("E:\\atuo");//Add a directory where users save pictures path =  p.getimagepath (); System.out.println (path.length); screen s = new Screen (); Try {s.click ("App.png");}  catch  (findfailed e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();} Try {thread.sleep (6000);}  catch  (interruptedexception e)  {// TODO Auto-generated catch  Blocke.printstacktrace ();} Driver.quit ();}}



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.