selenium-rc

Is there any method in WebDriver with Java for controlling speed of browser?

老子叫甜甜 提交于 2019-11-29 10:23:08
When I use Selenium RC there is a method setSpeed as: selenium.setSpeed("500"); What is the way to control speed of browser in Selenium WebDriver? You can use Thread.Sleep(500) (or equivalent) in whatever language you are using to run webdriver. This will cause the thread to pause for an exact number of milliseconds. Alternatively you can use explicit or implicit waits described here . Explicit waits allow you to define an ExpectedCondition . Webdriver will check the condition every 500 milliseconds until it returns true, (after which execution will resume immediately). Implicit waits cause

Difference between isElementPresent and isVisible in Selenium RC

纵饮孤独 提交于 2019-11-29 10:18:36
What is the difference between element isElementPresent and isVisible in Selenium RC. I get true for selenium.isElementPresent() and selenium.isVisible() If I get false for selenium.isElementPresent() I get Exception on selenium.isVisible() isElementPresent() - This method basically tests if the element we are looking for is present somewhere on the page. isVisible() - looks for display: none style tag - this might throw a null pointer if we aren't careful...thus to see if an element is visible first check if the element is present using isElementPresent() method. Then try checking if the

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

柔情痞子 提交于 2019-11-29 09:07:39
I'm trying to run a Junit Test case which i exported from Selenium IDE. Im getting above exception.I'm using Windows XP,Firefox 20.0.1,and using selenium-server-standalone-2.28.0.jar.Upon run, a blank Firefox window is opened. When I close that window i get below exception in console org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:96) at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:142) at

Get PID of Browser launched by selenium

你说的曾经没有我的故事 提交于 2019-11-29 06:20:52
问题 I would like to get the PID of the browser launched by selenium. Is there any way to get it done? 回答1: Using the Python API, it's pretty simple: from selenium import webdriver browser = webdriver.Firefox() print browser.binary.process.pid # browser.binary.process is a Popen object... If you're using Chrome, it's a little more complex, you go via a chromedriver process: c = webdriver.Chrome() c.service.process # is a Popen instance for the chromedriver process import psutil p = psutil.Process

Selenium: Ajax Testing

帅比萌擦擦* 提交于 2019-11-29 03:49:56
问题 Please brief me about the Ajax testing with selenium RC. As in Ajax element not reflect on the view-source, but using firebug we can see the changes in HTML source code. There are two methods associated with it Ajax testing.. 1-The method "waitForCondition (java.lang.String script, java.lang.String timeout), to provide script we have to create a java script by own or it should be the same Ajax script/java script present on the web page. Please correct me if i am wrong on below point.. 2-The

How can I count the number of elements that match my CSS selector?

我的梦境 提交于 2019-11-29 02:55:00
I am trying to use SeleniumRC to test my GWT App and am trying to match elements using CSS selectors. I want to count the number of enabled buttons in the following HTML. A button is enabled if it is under a <td> with class="x-panel-btn-td " and disabled if it is under a <td> with class="x-panel-btn-td x-hide-offsets" . So basically, I want to retrieve the number of buttons under all <td> s with the class x-panel-btn-td . <table cellspacing="0"> <tbody> <tr> <td id="ext-gen3504" class="x-panel-btn-td "> <em unselectable="on"> <button id="ext-gen3506" class="x-btn-text" type="button">OK</button

How to use regex in selenium locators

点点圈 提交于 2019-11-28 23:40:55
I'm using selenium RC and I would like, for example, to get all the links elements with attribute href that match: http://[^/]*\d+com I would like to use: sel.get_attribute( '//a[regx:match(@href, "http://[^/]*\d+.com")]/@name' ) which would return a list of the name attribute of all the links that match the regex. (or something like it) thanks The answer above is probably the right way to find ALL of the links that match a regex, but I thought it'd also be helpful to answer the other part of the question, how to use regex in Xpath locators. You need to use the regex matches() function, like

What are the differences between 'Selenium-server-standalone.jar' and 'Selenium Client & WebDriver'?

亡梦爱人 提交于 2019-11-28 22:45:07
What are the Implementations differences between 'Selenium-server-standalone.jar' and 'Selenium Client & WebDriver'. Following is the link from SeleniumHQ.org website [ 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 " I know first one is Formerly known as Selenium RC and second one is Selenium 2.0(Webdriver). But Is the latest version supporting all the jars in Webdriver in Selenium Server. I have only Selenium Server available, Did

Flash automation using Selenium RC

跟風遠走 提交于 2019-11-28 21:58:10
I'm struggling a lot to automate Flash using Selenium RC. Can any one please give me a sample Flash application code (methods) and the Selenium RC code to automate the same. You might also want to take a look at FlashSelenium . They have a working example documented. That worked for me. Selenium can not automate applications that work within their own blackbox in the browser. This means that Selenium can not test Silverlight and Flash. There is Flexmonkium which is a Selenium FlexMonkey bridge that you could use. There are details about it here Genie is also another tool you may be able to

How to resize/maximize Firefox window during launching Selenium Remote Control?

夙愿已清 提交于 2019-11-28 20:23:24
I am using Selenium Remote Control . During executing the tests the actual Firefox window is so small. I want it full screen so I can see what is happening. How can I maximize the browser screen? Try the windowMaximize command: selenium.windowMaximize(); You can also set a specific width and height using the following command: selenium.getEval("window.resizeTo(X, Y); window.moveTo(0,0);") Where X is the width and Y is the height. This works for me. All the other solutions didn't work in FF7. WebDriver driver = ((WebDriverBackedSelenium) selenium).getWrappedDriver(); driver.manage().window()