Friday, May 4, 2012

code for searching images from google using Selenium Rc

code for searching images from Google using Selenium RC and Eclipse package tests; import com.thoughtworks.selenium.*; import java.util.regex.Pattern; class SearchImages{ public static Selenium selenium = null; public static void testUntitled() throws Exception { selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.google.co.in//"); selenium.start(); selenium.open("//"); selenium.click("css=#gb_2 > span.gbts"); selenium.waitForPageToLoad("30000"); selenium.type("id=lst-ib", "ram"); selenium.click("name=btnG"); selenium.waitForPageToLoad("50000"); selenium.click("css=i.close_btn"); selenium.waitForPageToLoad("50000"); } public static void main(String args[]){ try { SearchImages.testUntitled(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }

1 comment:

  1. SWIFT Interview questions on

    http://testwithus.blogspot.in/p/swift.htm

    For selenium solution visit
    http://testwithus.blogspot.in/p/blog-page.html


    For QTP interview questions

    http://testwithus.blogspot.in/p/qtp-questions.html


    www.searchyourpolicy.com


    ReplyDelete