selenium-rc

How to use getEval() to verify the typeof of a variable in selenium

筅森魡賤 提交于 2019-12-13 18:13:53
问题 I want to do this in selenium: var variable = editors; if (typeof(variable) == "undefined") {}; but I am not entirely sure how to do it with the getEval() method. 回答1: Since you have not mentioned where editors is coming from I am going to assume that it is on the page. var win = this.browserbot.getUserWindow(); will give you access to window. selenium.getEval("var win = this.browserbot.getUserWindow();var variable = win.editors; typeof ( variable) === 'undefined';"); ****Edit from comment***

Could not start Selenium session: Failed to start new browser session: Error while launching browser

柔情痞子 提交于 2019-12-13 17:11:19
问题 I initialize the selenium like public void setUp() throws Exception { setUp("http://localhost/", "*firefox"); } and I write my test in the method like public void testUntitled() throws Exception { boo(); foo(); } But it gives error like java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Error while launching browser at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) at com.thoughtworks.selenium.SeleneseTestBase.setUp

Even If Testcase failed It is going in “onTestSuccess(ITestResult tr)” method of ListenerClass

断了今生、忘了曾经 提交于 2019-12-13 04:47:17
问题 I got one issue I added ListenerClass with my test code but even if my test fails, it's going into onTestSuccess(ITestResult tr) method of ListenerClass and everytime I am getting Test case passed, like if I am using selenium.isTextPresent(expectedResult) , even if expected result is not present its going in onTestSuccess(ITestResult tr) . What issue it is. Login.java package testPackage; import java.io.File; import java.util.HashMap; import java.util.List; import java.util.Map; //import

Could I verify text in image using Selenium

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 00:45:19
问题 I have an app very similar to Google/Yahoo map. I search for a location and it is displayed on map. When I see html of page, there are many segments and all of them are images. I wonder if there is any way to verify that text for searched location is available on page. For example if I search http://maps.yahoo.com/#mvt=m&lat=36.298746&lon=-115.139974&zoom=12&q1=las%20vegas There would be "Las Vegas" displayed on page. Now how do I verify that "Las Vegas" is really displayed on page? 回答1: So

firefox: flash not loading if tab inactive/window minimized

喜你入骨 提交于 2019-12-13 00:36:59
问题 I have encountered a problem I believe to be related to what's stated in the topic. With selenium I'm currently automating tests for a website having flash elements for user inputs. While everything works fine when executing these tests on my computer locally, it fails to load the embeded flash if I start selenium on a remote Windows XP machine. However, the flash just loads fine if I start the tests while I'm logged in via remote desktop. This leads me to the assumption that whithout any

Selenium RC upload file

十年热恋 提交于 2019-12-12 17:47:23
问题 can I upload files using selenium RC in IE? 回答1: Go through this post . will help you to upload file in selenium RC http://automationtricks.blogspot.com/2010/09/how-to-upload-file-in-selenium.html Thanks Niraj 回答2: The short answer is that in general you can't, due to browser security restrictions. Think about it, if Javascript code could programmatically upload a file to the server, it could send sensitive files to the server without the user ever noticing. There are ways to work around it,

Selenium.click not working on some anchor elements

最后都变了- 提交于 2019-12-12 10:56:15
问题 The application that am working on was recently revamped and as part of that a new JQuery calendar was introduced. I need to click on a link in the calendar to select the time and date. However, Selenium.click is not working. The command gets executed, but nothing happens on the screen. To check whether my XPATH/CSS locator (I tried both) is correct, I added selenium.getText(locator) and selenium.highlight(locator) commands. Both worked!. No issues in that. Its ONLY the click that is not

How to maintain Selenium Grid?

时光毁灭记忆、已成空白 提交于 2019-12-12 09:18:10
问题 I have many VMs which are used as part of Grid. Some as RC and some as Hub. Due to the large number of VMs that is being used, it is a big task to maintain the grid now. To change the RC to point to a different hub, I will have to login to that machine kill the current RC run the java command again with a different hub URL Yes, I can use a batch script to restart all the machines. But what if I just want to change just one machine? Is it possible to create an application using JAVA RMI which

Locating select element in Selenium

怎甘沉沦 提交于 2019-12-12 05:27:50
问题 Below is the combobox: <TD ALIGN="left" id="oldcontent"> <select name="status" style="width=150" id="newcontentformat"><option value="14" selected="selected">text1</option> <option value="15">text2</option> <option value="16">text3</option></select> </TD> I need to select text2 in the combobox/dropdown.I have used the below: selenium.select("//select[starts-with(@name,status)","text2"); The probelm am facing is,its giving me an error text2 not found.Since there are may other select boxes

Selenium won't detect new window after clicking link

旧时模样 提交于 2019-12-12 02:39:34
问题 In my selenium script, I click a link (that is inside a frame or something generated so that a search through the source doesn't return it), which sends me to a site that redirects or is a shortcut to a download of a pdf. The pdf appears in a new window when this link is clicked. Unfortunately, SeleniumRC can't detect the new window, even if I use "wait_for_pop_up" (I'm using python btw, if it matters). WebDriver can detect the new window, so to get around this I've been using a combination