Tag: selenium rc

如何在java代码中设置代理配置

我正在尝试用Java编写一个类来启动我的Selenium Server,以防它由于某种原因而关闭。 我在这里找到了很好的帮助: http : //www.testingexcellence.com/how-to-start-selenium-server-with-java-code/ 我看到一些配置参数可以使用类RemoteControlConfiguration和setPort,setLogOutFileName,setTimeoutInSeconds等方法设置。 问题是我的Selenium Server以这种方式连接到代理: java -jar selenium-server.jar -Dhttp.proxyHost=my.proxy.com -Dhttp.proxyPort=8080 不幸的是,我还没有找到如何把它放到java代码中。 我的问题是:是否可以在java中设置proxyHost和proxyPort值? 谢谢你的时间=) } {灵丹妙药

使用selenium获取CSS属性值

如何使用selnium RC获取CSS类的属性值 我尝试使用webdriver但无法获得所需的内容

selenium,我该如何选择新窗口

我在Eclipse中用TestNG运行我的selenium rc测试。 我有一个试图打开新浏览器页面的链接。 如何选择此新页面进行操作? 我用这个代码: selenium.selectWindow(“name=NewPage”); 但它说找不到页面。 我还尝试使用以下代码定义页面ID或标题: String[] wins = selenium.getAllWindowIds(); for (String s : wins) System.out.println(“win: ” + s); 它没有定义我新打开的窗口: win: MainPage win: 如果使用selenium.getAllWindowNames()我win: selenium_main_app_window win: selenium_blank65815 。 我写这段代码selenium.selectWindow(“name=blank99157”); 但得到错误 – ERROR: Window does not exist. If this looks like a Selenium bug, make sure to read http://seleniumhq.org/docs/02_selenium_ide.html#alerts-popups-and-multiple-windows for potential workarounds. ERROR: Window […]

如何以编程方式使用TestNG运行Selenium Java测试?

我使用Selenium RC和Java一起使用TestNG作为测试框架。 我正在使用Eclipse作为IDE。 我想非常轻松地从我自己的程序中调用TestNG。 我怎样才能做到这一点?

如何从下拉列表中选择任何随机值?

我正在使用Java研究selenium。 在我的应用程序中,我想从下拉列表中选择任何随机值。 请告诉我怎么可能?

30000ms后,当我尝试使用Selenium RC单击“提交”按钮进入下一页时超时

我正在使用Selenium RC by java。 在第1页填写必要的数据 – > Click提交按钮进入下一页。 我的代码是: selenium.click(“Submit”); selenium.waitForPageToLoad(“30000”); 单击“提交”按钮后,我发现错误: com.thoughtworks.selenium.SeleniumException: Timed out after 30000ms 任何人都可以帮帮我吗?

‘Selenium-server-standalone.jar’和’Selenium Client&WebDriver’有什么区别?

‘Selenium-server-standalone.jar’和’Selenium Client&WebDriver’之间的实现差异是什么? 以下是SeleniumHQ.org网站[ http://www.seleniumhq.org/download/]的链接.. http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar “ http://selenium-release.storage.googleapis.com/2.44/selenium-java-2.44.0.zip ” 我知道第一个是以前称为Selenium RC,第二个是Selenium 2.0(Webdriver)。 但最新版本是否支持Selenium Server中Webdriver中的所有jar。 我只有Selenium Server可用,Selenium Webdriver中的所有方法都支持Selenium Server吗? 同样,它们之间的区别有什么不同? 可以帮助 /谢谢

在Selenium的inconginto模式下运行chrome浏览器

我想通过selenium在incongito模式下运行chrome。 我用Google搜索了足够的内容,并在此链接的帮助下找到了如何直接在incongito模式下运行chrome: 右键单击Google Chrome的快捷方式,然后选择“属性”。 在“目标”字段的“快捷方式”选项卡上,在程序路径末尾添加-incognito。 所以在“目标”字段中你应该有”C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” –incognito 但是我没有得到如何在selenium中运行它。

在整个selenium套件中使用相同的Web驱动程序

我有一个inheritance自相同基类的以下selenium测试套件,当我运行整个测试套件时,如何让测试使用相同的Web驱动程序实例? 我也希望孤立地运行每个测试。 我相信这将大大减少运行套件所需的时间。 此测试从maven运行,而maven又运行每个测试类。 @RunWith(Suite.class) @SuiteClasses({ AdminPortalTestSuite.class, DevPortalTestSuite.class, CommonTestSuite.class }) public class SeleniumTestSuite { } 基类所有测试都inheritance自 @BeforeClass public static void setUp() throws Exception { if (null == baseUrl || !baseUrl.startsWith(“https://”)) { baseUrl = “https://localhost:8443”; } if (null == browser || browser.startsWith(“${“)) { browser = “firefox”; } //retrieve properties including locale. retrieveProperties(); Thread.sleep(4000); setUpDriver(); } @After […]

Assertion失败时如何继续执行

我正在使用Selenium RC使用Java与eclipse和TestNG框架。 我有以下代码片段: assertTrue(selenium.isTextPresent(“Please enter Email ID”)); assertTrue(selenium.isTextPresent(“Please enter Password”)); 第一个断言失败,执行停止。 但我想继续进一步的代码片段。