selenium-rc

selenium.open() becomes unresponsive in an iterative test

假装没事ソ 提交于 2019-12-02 08:17:06
I have a set of test steps that I have to execute with different parameters. I have scripted this in Eclipse/TestNG, driven by the parameters supplied via an excel sheet. Now, the test steps involve setting the property of a page, and then opening another page to confirm that the property is set. So, in effect, I use a simple selenium.open("my_first_url"); at the beginning of the test, set the property, and then another selenium.open("my_second_url"); to open the other url where the assertion is performed. There are about 9-10 sets of test data. Here's the problem- By the time the test

How to select any random value from a dropdown?

怎甘沉沦 提交于 2019-12-02 01:04:41
I am working on selenium using Java. In my application I want to select any random value from the dropdown. Please tell how is it possible? Well, first get the total number of items in the dropdown. Then generate a random number between 0 and dropdown items count. Then select that number as index to set your dropdown item Use getSelectOptions to get an array of options of the select box. Then generate a random integer between 0 (inclusive) and the length of the array (exclusive). Then use select with an index locator to select the randomly chosen option. What Sachin said. I know often it's

selenium RC doesnt run the whole test suite

吃可爱长大的小学妹 提交于 2019-12-01 22:34:02
问题 I'm trying to run an HTML testSuite with Selenium RC. The browser starts, the first test runs, and it stops. It doesn't continue to the second test case. I named both the test cases with .html extension. I am using Firefox. If I run them manually, individually from the selenium RC test runner window they run ok. What am I missing, this seems pretty simple but yet I'm not able to get this working. I am using Selenium RC 1.0.3 java -jar selenium-server.jar -firefoxProfileTemplate"C:\Users\sicky

Selenium href blank New Window test

梦想与她 提交于 2019-12-01 21:21:53
问题 So, using Selenium, I want to test links on a page and see if they open a new window. They are NOT javascript links, just a basic href "target=_blank". I want to make sure the newly opened window actually loaded a page. I can do all the scripting to get the link clicked, but when i test for page Title, I get the page I'm testing on, not the new window that is on top. How do I target that new window and check to see if THAT page loaded? thanks 回答1: The following worked for me with a form with

selenium RC doesnt run the whole test suite

你离开我真会死。 提交于 2019-12-01 20:46:28
I'm trying to run an HTML testSuite with Selenium RC. The browser starts, the first test runs, and it stops. It doesn't continue to the second test case. I named both the test cases with .html extension. I am using Firefox. If I run them manually, individually from the selenium RC test runner window they run ok. What am I missing, this seems pretty simple but yet I'm not able to get this working. I am using Selenium RC 1.0.3 java -jar selenium-server.jar -firefoxProfileTemplate"C:\Users\sicky\AppData\Roaming\Mozilla\Firefox\Profiles\zvt0jj7c.default" -htmlsuite "*firefox" "https://4.17.8.9/"

Selenium: How do I assert that a certain element is present in a certain cell of a certain table?

我只是一个虾纸丫 提交于 2019-12-01 17:28:42
I have a table on my page which is supposed to contain a certain element. I can identify the table by its name (it has a unique name), and I can also identify the element easily. I would like to assert that the element is present on row r , column c of the table. What is the cleanest way of doing it using Selenium commands? Remarks: I don't want to use more than the table name in order to locate it (I don't want all the div\div\table\div\tbody\td\tr[r]\td[c] in the code). I'm using Selenium within PHPUnit. Hence, I can use PHP logic for the task, though I don't want any complex logic for such

Selenium: How do I assert that a certain element is present in a certain cell of a certain table?

和自甴很熟 提交于 2019-12-01 16:28:26
问题 I have a table on my page which is supposed to contain a certain element. I can identify the table by its name (it has a unique name), and I can also identify the element easily. I would like to assert that the element is present on row r , column c of the table. What is the cleanest way of doing it using Selenium commands? Remarks: I don't want to use more than the table name in order to locate it (I don't want all the div\div\table\div\tbody\td\tr[r]\td[c] in the code). I'm using Selenium

XPath or CSS in Selenium RC with Java is not working

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 12:53:35
I am trying to automate the following scenario with selenium RC: Open Google home page and enter "Software" in search box and then click on search button. Click on the first link of multiple links retrieved by Google search. As I don't see either name or id attributes for these links and as this link's content is dynamic, I am trying to use XPath or CSS. From Firebug, I got XPath and also CSS by right clicking then copy XPath, copy CSS. XPATH:/html/body/div[2]/div/div/div[6]/div[2]/div/div[2]/div/ol/li[1]/div/span/h3/a CSS:html body#gsr div#main div div#cnt div#nr_container div#center_col div

Set user-agent in Selenium RC

僤鯓⒐⒋嵵緔 提交于 2019-12-01 10:27:31
The main idea of using the Custom Headers in Selenium RC was to add the User-agent and the phone nomber to my HTTP requests. For that purpose, I'm using Selenium Server as a proxy in Firefox (see how-to use addCustomRequestHeader properly ) This is more or less the code I'm using: @Before public void setUp() throws Exception { setUp(URL, NAVIGATOR); selenium.start("addCustomRequestHeader=true"); Thread.sleep(5000); selenium.windowMaximize(); } @Test public void testVerifyHomePage() { System.out.println("**** testVerifyHomePage Executing"); selenium.addCustomRequestHeader("x-Nokia-Msisdn",

Set user-agent in Selenium RC

本小妞迷上赌 提交于 2019-12-01 10:01:53
问题 The main idea of using the Custom Headers in Selenium RC was to add the User-agent and the phone nomber to my HTTP requests. For that purpose, I'm using Selenium Server as a proxy in Firefox (see how-to use addCustomRequestHeader properly) This is more or less the code I'm using: @Before public void setUp() throws Exception { setUp(URL, NAVIGATOR); selenium.start("addCustomRequestHeader=true"); Thread.sleep(5000); selenium.windowMaximize(); } @Test public void testVerifyHomePage() { System