selenium-rc

how-to use addCustomRequestHeader properly

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 04:33:38
问题 I'm trying to add headers into my HTTP request for a particular test case. That's very important since I'm trying to test an application meant to be used in mobile phones. I manage to find out about the method addCustomRequestHeader(String arg0, String arg1) . Unfortunately, it seems I don't know how to use it properly. This is my Test Suite: package testscripts; import com.thoughtworks.selenium.DefaultSelenium; import com.thoughtworks.selenium.SeleneseTestCase; import com.thoughtworks

how to get attribute value using selenium and css

♀尐吖头ヾ 提交于 2019-11-28 03:50:02
问题 I have the following HTML code: <a href="/search/?p=2&q=move&mt=1"> 2 </a> I would like to get what is contained in href, ie, I was looking for a command which would give me "/search/?p=2&q=move&mt=1" value for href. Could someone please help me with the respective command and css locator in selenium, for the above query? if I have something like: <a href="/search/?p=2&q=move&mt=1"> 2 </a> <a href="/search/?p=2&q=move&mt=2"> 3 </a> Out of these two if I was to get the attribute value for href

Testing flash applications on web using selenium [closed]

不想你离开。 提交于 2019-11-28 03:40:32
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I want to test Microstrategy applications using any web testing tools. I figured out seleniun serves my purpose well. But

Difference between isElementPresent and isVisible in Selenium RC

北城以北 提交于 2019-11-28 03:14:59
问题 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() 回答1: 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

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

自作多情 提交于 2019-11-28 02:30:29
问题 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

Use same web driver throughout selenium suite

这一生的挚爱 提交于 2019-11-28 02:06:44
I have a the following selenium test suite inheriting from the same base class, how to I have the tests use the same web driver instance when i run the entire test suite?. I also want to run each tests in isolation aswell. I believe this will cut down the time it takes to run the suite considerably. This test is run from maven that in turn runs each test class. @RunWith(Suite.class) @SuiteClasses({ AdminPortalTestSuite.class, DevPortalTestSuite.class, CommonTestSuite.class }) public class SeleniumTestSuite { } Baseclass all tests inherit from @BeforeClass public static void setUp() throws

How can automation testing on Silverlight using Selenium be done?

你说的曾经没有我的故事 提交于 2019-11-28 01:52:11
I am looking for a way by which I can automate my application build on Silverlight. I need to use Selenium as required, can anyone tell a process or any good tutorial by which I can achieve what I require. Thanks in advance. therobyouknow Take a look at: http://code.google.com/p/silverlight-selenium/ and Silverlight testing: Watin vs Selenium comparison Also bear in mind that Silverlight's future looks uncertain: http://www.hightechnewstoday.com/apr-2011-high-tech-news-archives/74-apr-13-2011-high-tech-news.shtml and http://www.electronista.com/articles/11/11/09/microosft.may.axe.silverlight

Load an external js file containing useful test functions in selenium

江枫思渺然 提交于 2019-11-28 00:30:42
The runScript command in selenium is really useful, and I'm using it to total values in a table and then store the value like this <tr> <td>runScript</td> <td>var cumulative = 0.0; $('table.quote-review-group-component').eq(0).find('tr').each( function( i,el ){var singleStackTotal = $(el).find('td').eq(4).html();if( singleStackTotal ){cumulative += parseFloat( singleStackTotal.substring(1) );} }); cumulative = cumulative.toFixed(2)</td> <td></td> </tr> <tr> <td>storeEval</td> <td>selenium.browserbot.getUserWindow().cumulative</td> <td>cumulative</td> </tr> <tr> <td>echo</td> <td>${cumulative}<

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

◇◆丶佛笑我妖孽 提交于 2019-11-27 20:44:59
问题 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? 回答1: 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. 回答2: This works for me. All the other solutions didn't

Selenium testing without browser

人盡茶涼 提交于 2019-11-27 18:45:02
I use Selenium RC for testing. Now to perform a load test, I want to run parallel test cases. Is there any way to run them without opening a browser? Derek Lu To set up on Centos (do all installation as root) Install pip Download https://bootstrap.pypa.io/get-pip.py python get-pip.py Installing selenium If you have pip on your system, you can simply install or upgrade the Python bindings: pip install -U selenium Alternately, you can download the source distribution from PyPI (e.g. selenium-2.53.1.tar.gz), unarchive it, and run: python setup.py install install the program: pyvirtualdisplay pip