selenium-rc

How to mouseover a WebElement using Selenium RC2 in Firefox

喜夏-厌秋 提交于 2019-12-05 20:06:12
Using Selenium's Firefox WebDriver 2.20, I need to display a tooltip that appears when the mouse hovers over a link on my web page. I've tried using Selenium's Action class to do this, but I get a ClassCastException: $Proxy7 incompatible with org.openqa.selenium.internal.Locatable. Here is what I've tried so far: Actions builder = new Actions(driver); WebElement link = driver.findElement(By.tagName("a")); builder.moveToElement(link).build().perform(); The ClassCastException happens in the moveToElement() method, when the WebElement that I passed to the function is cast to a Locatable object.

Selenium - Cross domain and HTTPS problem

余生颓废 提交于 2019-12-05 19:49:18
I use Selenium to test my website. The website need to access an external catalog to select some items from it. The problem is this catalog is published on another domain with HTTPS protocol. I've searched and read many topics on the internet about Selenium and Cross domain problems, but I still don't find the answer yet. Some topics said that the *iehta browser will overcome this issue, but in fact it could not do that. I also try *iexplore, *iexploreproxy, *firefox, *firefoxproxy as well, but the results are the same. Could you please give me the solution for this problem? Thanks in advance!

How do I test which element has the focus in Selenium RC?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 18:50:39
How do I test which element has the focus in Selenium RC? The following locator should select the active element in the document: dom=document.activeElement If a form field or similar element has focus, then it should be the active element. Hope this helps. As AlistairH mentions, you can use document.activeElement on most current browsers. To use this in Selenium you can store the active element and compare it to the active element. Below is an example for Selenium IDE, which should point you in the right direction for Selenium RC too. storeEval | this.browserbot.findElement("name

type into iframe in selenium

…衆ロ難τιáo~ 提交于 2019-12-05 14:45:29
I need to type data into an iframe . I referred to Typing in a IFrame with Selenium IDE but selenium.selectFrame(<xpath>) returns: Element not found error and no css has been defined for the iframe . Using firebug: <iframe frameborder="0" allowtransparency="true" tabindex="0" src="" title="Rich text editor, templateWizardCKEditor1, press ALT 0 for help." style="width: 100%; height: 100%;"/> What could be a solution for this? Somesh I found a solution for the same... driver.switchTo().frame("ext-gen298"); WebElement editable = driver.switchTo().activeElement(); editable.sendKeys("Your text here

Selenium click right on mouse or press option key form keyboard

半腔热情 提交于 2019-12-05 10:55:52
问题 Using selenium how can I click on the right click of mouse or press on the option key from keyboard(This key is usually available between right ALT and CTRL key) 回答1: If you are trying to open the context menu, there is a selenium.contextMenu(locator) . This is the menu that opens up when you right click or press that option key. This example shows you how to open a page element in a new tab from context menu. The page used for example is seleniumhq.org. This code will right click on the logo

Read Message From Alert and click on OK

只愿长相守 提交于 2019-12-05 07:09:20
I want to read the message which is there in Alert. Example: If a alert shows "Wrong E-mail address". How to read it? Means i want to store that message in a string. How to click on OK inside Alert...?? How to do it using Selenium ? I am assuming you are using the Selenium WebDriver. // Get a handle to the open alert, prompt or confirmation Alert alert = driver.switchTo().alert(); // Get the text of the alert or prompt alert.getText(); // And acknowledge the alert (equivalent to clicking "OK") alert.accept(); The answer was found here . If you are using Selenium RC, take a look this webpage. I

Using R to connect Selenium-Server-Standalone

爱⌒轻易说出口 提交于 2019-12-05 06:42:35
问题 As refer to the post Accessing the Selenium API in R in this website, I can create a webdriver. However I unable to get the element details as same as Python can. May I know how to do? I would like to scrape the soccer matches table of every single round... # using R library(RCurl) library(RJSONIO) library(XML) # running selenium system("java -jar selenium-server-standalone-2.35.0.jar") baseURL<-"http://localhost:4444/wd/hub/" server<-list(desiredCapabilities=list(browserName='firefox'

How to close or minimize browser windows with Selenium RC?

痴心易碎 提交于 2019-12-05 02:39:32
问题 Every time I launch a Firefox instance via Selenium RC I get 3 windows that I don't need appearing: the add-ons windows notifying me that "3 new add-ons have been installed" (since I'm using a custom profile for Selenium to which it evidently adds the DocumentReadyState, KillFF, and Selenium RC Runner add-ons) the http://localhost:4444/selenium-server/core/Blank.html?start=true window the dual window with two tabs starting with chrome://src/content/RemoteRunner.html?sessionId=... each I don't

Selenium locator for <label for=“x”>

偶尔善良 提交于 2019-12-05 00:51:59
With ASP.NET the tag IDs are pretty volatile so to make my tests more robust I want to locate elements by their label texts. I have played some with WatiN and it does this perfectly but that project seem kind of dead nowadays so I thought I'd look into Selenium as well before I decide on a framework. I have html that looks something like this <label for="ctl00_content_loginForm_ctl01_username">Username</label>: <input type="text" id="ctl00_content_loginForm_ctl01_username" /> I don't want to type: selenium.Type("ctl00_content_loginForm_ctl01_username", "xxx"); That is too reliant on the ID. In

Selenium Webdriver : Reusable xml parsing class method is not working due to return type unknown

和自甴很熟 提交于 2019-12-04 22:00:38
My objective is to Create Reusable xml parsing class concerning that return type could be array or arraylist My code is working but I wanted reusablity I am unable to create reusable class/method due to return type which could array or arraylist is not working.** 1) I have created a xml file as follows: <SearchStrings> <Search id="1111" type="high"> <Questions>What is software Testing?</Questions> <Tips>How to connect database with eclipse ?</Tips> <Multiple>Who was the first prime minister of India? </Multiple> <Persons>Who is Dr.APJ Abdul Kalam </Persons> </Search> <Search id="2222" type=