selenium-ide

Click a button with XPath containing partial id and title in Selenium IDE

五迷三道 提交于 2019-11-30 11:15:25
Using Selenium IDE, I'm trying to click a button within a table on a webpage using XPath with a partial id and a title from the element. The XPath I'm using is: xpath=//*[contains(@id, 'ctl00_btnAircraftMapCell')]//*[contains(@title, 'Select Seat')] and thats the entire html code for an example of the buttons im trying to click: <li id="ctl00_MainContent_repAircraftMap_ctl20_repAircraftMapRow‌​_ctl00_liAircraftMap‌​Cell" class=""> <a id="ctl00_MainContent_repAircraftMap_ctl20_repAircraftMapRow‌​_ctl00_btnAircraftMa‌​pCell" href="javascript:void(0)" seatnumber="20A" mapbindattribute="1124"

Unable to launch IE browser in selenium webdriver

旧街凉风 提交于 2019-11-30 10:20:22
I have written a sample code to launch IE browser and load google page. public class Sample { public static void main(String[] args) { // TODO Auto-generated method stub System.setProperty("webdriver.ie.driver","H:/IEDriverServer.exe"); WebDriver driver=new InternetExplorerDriver(); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS); driver.get("http://www.google.com"); } } But when I run this script it launches browser and it gets closed immediately (less than 2 sec) without prompting any error and the script wont terminates. This is what I can

In Selenium IDE btnDelete (Button) not found

邮差的信 提交于 2019-11-30 09:55:35
问题 Help URL : URL[1]: http://i.stack.imgur.com/s5ZnK.png' This URL also display a delete button code. Selenium IDE: Command : Target clickAndWait : id=ctl00_Dialogproxy_deletenews_btnDelete Log Table value: [info] Executing: |clickAndWait | id=ctl00_Dialogproxy_deletenews_btnDelete [error] Element id=ctl00_Dialogproxy_deletenews_btnDelete not found Actually i am not understanding what is the real issue because manually delete (button) functionality proper run but selenium IDE give the above

Get element with jquery and selenium IDE 1.0.8

守給你的承諾、 提交于 2019-11-30 09:10:44
I'm trying to get element with jquery and Selenium IDe 1.0.8. <td>storeValue</td> <td>$('#result').find('img').filter('[alt="NameOfPhoto"]').eq(0)</td> <td></td> And in log I get [error] Element $('#result').find('img').filter('[alt="NameOfPhoto"]').eq(0) not found When I put this command in firebug I get this element :/ Why it doesn't work ? EDIT: Alternatively for example you can give me code how to get id of first object whith JAVA tag at main page of stackoverflow. TAG: <a rel="tag" title="show questions tagged 'java'" class="post-tag" href="/questions/tagged/java">java</a> and the example

Selenium WebDriver - Finding Elements using cssSelector and nth child

浪尽此生 提交于 2019-11-30 06:57:28
<ul> <li class="active"> <a href="#"> <i class="fa fa-home"></i><br> <span class="title">Home</span> </a> </li> <li> <a href="#"> <i class="fa fa-rss-square"></i><br> <span class="title">Posts</span> </a> </li> <li> <a href="#"> <i class="fa fa-calendar"></i><br> <span class="title">Events</span> </a> </li> <li> <a href="#"> <i class="fa fa-bar-chart-o"></i><br> <span class="title">My Activity</span> </a> </li> <li> <a href="#"> <i class="fa fa-edit"></i><br> <span class="title">Assessments</span> </a> </li> </ul> I want to locate the respective span element. I want to check the order of the

Selenium: How to wait for options in a select to be populated?

泪湿孤枕 提交于 2019-11-30 06:55:38
问题 I am using Selenium for the first time and am overwhelmed by the options. I am using the IDE in Firefox. When my page loads, it subsequently fetches values via an JSONP request, with which it populates options in a select. How do I get Selenium to wait for a certain option in the select to be present before proceeding? 回答1: I think you should be use waitForElementPresent command. If possible let's me see your selenium IDE code. 回答2: I used waitForElementPresent with a css target . Example: To

Why do my tests fail when run together, but pass individually?

有些话、适合烂在心里 提交于 2019-11-30 06:47:52
When I write a test in Visual Studio, I check that it works by saving, building and then running the test it in Nunit (right click on the test then run). The test works yay... so I Move on... Now I have written another test and it works as I have saved and tested it like above. But, they dont work when they are run together. Here are my two tests that work when run as individuals but fail when run together: using System; using NUnit.Framework; using OpenQA.Selenium.Support.UI; using OpenQA.Selenium; namespace Fixtures.Users.Page1 { [TestFixture] public class AdminNavigateToPage1 :

How to get actual JavaScript value in onclick from webbrowser control?

≡放荡痞女 提交于 2019-11-30 05:01:53
I'm looking for a way to get the JavaScript code defined inside of onclick. I'm using .NET 2.0 C# Visual Studio 2005. Example: <span id="foo" onclick+"window.location.href='someURL'>click here</span> My goal is to get the string "window.location.href='someURL'" . Scenario: A user clicks on web page element, the tag shown above for instance, inside of WebBrowser control. Then the clicked tag is refereed to H tmlElement object . In WebBrowser control I then call HtmlElement object's getAttribute("onclick") , it just gives me " System.__ComObject". I've searched how to deal with it then found

Selenium IDE: How to Pass Variables

99封情书 提交于 2019-11-30 03:59:14
I have 3 different accounts in a website that I want to login and print a report every single day. I've done a Selenium IDE recording that allows me to login and print the report, however, every day I have to change the variable 3 times (for the 3 different usernames and passwords). How can I pass a variable to the "value" field of the "type" command? Thank you. Best, Rohit Ware You can go with parameterization For parameterization you need to create js file For eg. Js file contains var username = ["parameterization1@mailinator.com", "parameterization2@mailinator.com"); var password = [

Testing jQuery Drag & Drop and Droppable with Selenium

删除回忆录丶 提交于 2019-11-29 23:20:23
问题 I have a page that makes use of jQuery Drag & Drop, and I would like to build a relatively robust test suite for this process using Selenium. Looking into Selenium, I've found that it has a Drag & Drop command on a jQuery plugin like: FullCalendar, but when I use the Selenium IDE to try to record 'dragging and dropping I don't get any recorded events. So should I try to target the events using jQuery selectors? Because the following don't work (targeting the '12p Lunch' on the example page)