Selenium UI element & Selenium RC integration problem

0 views
Skip to first unread message

satyadev

unread,
Aug 11, 2009, 2:27:55 AM8/11/09
to selenium-users...@googlegroups.com
Hi all,

I am unable to intergrate selenium ui-element with selenium rc.

steps I tried :
1) copybelow java scripts to user-extensions.js
chrome://selenium-ide/content/ui-element.js, chrome://selenium-ide/content/ui-map-sample.js\\ 2)use 'selenium.setExtensionJs' and above whole file content. before starting selenium browser.\\ 3) now try to Click UI element "ui=allPages::topics(topic=Code)" present in \\ ui-map-sample.js\\ 4) I got following error : \\ com.thoughtworks.selenium.SeleniumException: ERROR: Element ui=allPages::topics(topic=Code) not found\\      at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)\\      at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)\\      at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:167)\\      at SeleniumUIelementtest.main(SeleniumUIelementtest.java:19)\\ \\ What else i missed ?\\ \\ I am able to work with selenium-IDE with any issue but not with RC.\\ \\ \\ java code I used : \\ import com.thoughtworks.selenium.DefaultSelenium;\\ import com.thoughtworks.selenium.Selenium;\\ import java.io.ByteArrayOutputStream;\\ import java.io.File;\\ import java.io.FileInputStream;\\ \\ public class SeleniumUIelementtest {\\      static Selenium browser;\\      /**\\       * @param args\\       */\\      public static void main(String[] args) {\\           // TODO Auto-generated method stub\\           final String MAX_WAIT_TIME_IN_MS = "30000";          \\           SeleniumUIelementtest a = new SeleniumUIelementtest();\\           \\           browser = a.StartBrowser();     \\           browser.open("/");\\           browser.waitForPageToLoad(MAX_WAIT_TIME_IN_MS);          \\                          \\           browser.click("ui=allPages::topics(topic=Code)");\\           browser.waitForPageToLoad(MAX_WAIT_TIME_IN_MS);\\           browser.click("ui=subtopicListingPages::subtopic(subtopic=Browsers)");\\           browser.waitForPageToLoad(MAX_WAIT_TIME_IN_MS);\\           browser.stop();\\      }\\ \\      public Selenium StartBrowser()\\      {\\           browser = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.alistapart.com/");\\           setFileExtensionContent(browser);\\           browser.start();\\           return browser;\\      }\\      \\      public  void setFileExtensionContent(Selenium browser)\\      {\\      \\           try \\           {\\                     File file = new File("src/user-extensions.js");\\                     \\                     FileInputStream stream = new FileInputStream(file);\\                     ByteArrayOutputStream b = new ByteArrayOutputStream();\\                     byte[] buffer = new byte[4096];\\                     int read;\\                     while ((read = stream.read(buffer)) > 0) {\\                          b.write(buffer, 0, read);\\                     }\\                     \\                     String js = b.toString();\\                     System.out.println(js);\\                     if (js != null && js.length() > 0) {\\                          browser.setExtensionJs(js);\\                     }\\           } catch (Exception e) \\           {\\                System.out.print(e.toString());\\           }\\      }\\ }

Reply all
Reply to author
Forward
0 new messages