Search Results

Search found 443 results on 18 pages for 'selenium'.

Page 9/18 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Cucumber, capybara and selenium - Submiting a form without a button

    - by Daniel Cukier
    I have a test using Cucumber, capybara and selenium driver. This test should go to a form and submit it. The normal text would be Scenario: Fill form Given I am on the Form page When I fill in "field1" with "value1" And I fill in "field2" with "value2" And I press "OK" Then I should see "Form submited" The problem is that I don't have the OK button in the form I need a way to do the "form.submit", without clicking any button or link - the same as happens when you press ENTER when you are in a form field using the browser. I don't know how to tell capybara to submit a form. How can I do it?

    Read the article

  • In SELENIUM, how to I change focus to a new popup tab?

    I'm using Selenium and Firefox. I have a link on a page (say linkA) that opens a new page in a new tab. The new tab is displayed when linkA is clicked. I then want to interact with the new page. Here is my selenium script: click linkA pause 5000 selectWindow Title click linkB (note: linkB is on the new page) Selenium cannot identify the new tab. It reports: [warn] Link has target '_blank', which is not supported in Selenium! Randomizing target to be: selenium_blank24003 Is there any way to tell Selenium to interact with the displayed tab?

    Read the article

  • Maven - Selenium - Possible to run only one test

    - by Jonas Söderström
    Hi We are using JUnit - Selenium for our web tests. We use Maven to start them and build a surefire report. The test suite is pretty large and takes a while to run and sometimes single tests fail because the browser won't start. I want to be able run a SINGLE test using maven so I retest the tests that fail and update the report. I can use mvn test -Dtest=TESTCLASSNAME to run all the tests in one test class, but this is not good enough since it takes about 10 minutes to run all the tests in our most complicated test classes and it's very likely that some other test will fail (because the browser wont start) and this will mess up my report. I know I can run one test from Eclipse but that is not what I am looking for. Any help on this would be very appriciated

    Read the article

  • Using Selenium 2's IWebDriver to interact with elements on the page

    - by Andreas Grech
    I'm using Selenium's IWebDriver to write Unit Tests in C#. Such is an example: IWebDriver defaultDriver = new InternetExplorerDriver(); var ddl = driver.FindElements(By.TagName("select")); The last line retrieves the select HTML element wrapped in a IWebElement. I need a way to simulate selection to a specific option in that select list but I can't figure out how to do it. Upon some research, I found examples where people are using the ISelenium DefaultSelenium class to accomplish the following, but I am not making use of this class because I'm doing everything with IWebDriver and INavigation (from defaultDriver.Navigate()). I also noticed that ISelenium DefaultSelenium contains a ton of other methods that aren't available in the concrete implementations of IWebDriver. So is there any way I can use IWebDriver and INavigation in conjunction with ISelenium DefaultSelenium ?

    Read the article

  • Selenium testing with checksums (md5)

    - by Peter
    I am new at selenium testing and am writing a bunch of tests for a webpage that relies heavily on javascript user interaction. At first I wrote a lot of assertions of the style If I press button A" then assert number of visible rows = x, assert checkboxes checked are such assert title = bar .... [20 more] and so on. Then I switched to checksumming the HTML using MD5: If I press button A" then assert md5(html) = 8548bccac94e35d9836f1fec0da8115c. And it made my life a whole lot easier... But is this a bad practice in any way?

    Read the article

  • Spring Roo unable to generate Selenium tests because of Xerces error

    - by Wraith
    After watching Roo Google IO, I decided to try it out using this tutorial, but I'm getting stuck when trying to create Selenium tests. ~.web roo> selenium test --controller ~.web.PizzaOrderController Created SRC_MAIN_WEBAPP/selenium Created SRC_MAIN_WEBAPP/selenium/test-pizzaorder.xhtml Created SRC_MAIN_WEBAPP/selenium/test-suite.xhtml Undo create SRC_MAIN_WEBAPP/selenium/test-suite.xhtml Undo create SRC_MAIN_WEBAPP/selenium/test-pizzaorder.xhtml Undo create SRC_MAIN_WEBAPP/selenium com.sun.org.apache.xerces.internal.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element A person at this forum suggested removing Xerces from the classpath because Java 6 has its own XML parser based on Xerces. However, I haven't come across a clear way to remove something from the classpath, only setting it (which I think would be tedious each time). Does anyone know of a clear way to remove jars from the classpath? Has anyone encountered this Roo problem before and solved it another way?

    Read the article

  • Selenium RC htmlsuite error with IE

    - by Alina
    I am trying to use Selenium RC but i keep getting this error whenever i start the server. "HTML suite exception seen: java.lang.RuntimeException: sessionId 7643 doesn't exist; perhaps this session w as already stopped?" The command I use is java -jar C:\selenium-remote-control-1.0.3\selenium-server-1.0.3\selenium-server.jar -multiwindow -htmlSuite "*iexplore" "https://user1.apps.com/" "C:\TEMP\Selenium Tests\TestSuite1.html" "C:\TEMP\Selenium Tests\results.html" However with the same command if I change *iexplore to *firefox then it works. I need to run the test with IE, please help!Many thanks!!

    Read the article

  • Element not found blocks execution in Selenium

    - by Mariano
    In my test, I try to verify if certain text exists (after an action) using find_element_by_xpath. If I use the right expression and my test pass, the routine ends correctly in no time. However if I try a wrong text (meaning that the test will fail) it hangs forever and I have to kill the script otherwise it does not end. Here is my test (the expression Thx user, client or password you entered is incorrect does not exist in the system, no matter what the user does): # -*- coding: utf-8 -*- import gettext import unittest from selenium import webdriver class TestWrongLogin(unittest.TestCase): def setUp(self): self.driver = webdriver.Firefox() self.driver.get("http://10.23.1.104:8888/") # let's check the language try: self.lang = self.driver.execute_script("return navigator.language;") self.lang = self.lang("-")[0] except: self.lang = "en" language = gettext.translation('app', '/app/locale', [self.lang], fallback=True) language.install() self._ = gettext.gettext def tearDown(self): self.driver.quit() def test_wrong_client(self): # test wrong client inputElement = self.driver.find_element_by_name("login") inputElement.send_keys("root") inputElement = self.driver.find_element_by_name("client") inputElement.send_keys("Unleash") inputElement = self.driver.find_element_by_name("password") inputElement.send_keys("qwerty") self.driver.find_element_by_name("form.submitted").click() # wait for the db answer self.driver.implicitly_wait(10) ret = self.driver.find_element_by_xpath( "//*[contains(.,'{0}')]".\ format(self._(u"Thx user, client or password you entered is incorrect"))) self.assertTrue(isinstance(ret, webdriver.remote.webelement.WebElement)) if __name__ == '__main__': unittest.main() Why does it do that and how can I prevent it?

    Read the article

  • selenium and firefox timeout behavior

    - by Md. Reazul Karim
    I am facing this strange timeout behavior. I tried to load some page using: WebDriver drv = new FirefoxDriver(); drv.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); drv.get(url); String email = ""; try { WebElement aElem = Util.safeFindElementByXpath(drv, "//p[1]/a[1]"); if (aElem != null) { email = aElem.getAttribute("href"); } } catch (Exception e) { } drv.quit(); return email; The safeFindElementByXpath is: static WebElement safeFindElementByXpath(WebDriver driver, String xpath) { try { return driver.findElement(By.xpath(xpath)); } catch (NoSuchElementException e) { return null; } } Now I set the firefox network.http.connection-timeout and network.http.connection-retry-timeout both to 10. Now if I restart the firefox I can see the new values. But if I try to run the above code - the firefox window opens and it waits for a particular website for a long time. Hence I open another tab in the same firefox window and check the values of timeout and find them to be 90 and 250. If I change the values on that same window, the selenium code immediately finishes requesting for the page (ie it goes after the exception block). So the thing is that the same code will work on many sites and I don't know beforehand which site is invalid/down and I was thinking of putting this code in a separate thread and kill the thread after some time from the calling thread. But that is not possible I guess because the child thread has no way to poll anything as it is stuck at page request and can't go to the polling code afterwards. Now the thing is that I want any kind of hack/workaround to accomplish this: try getting the emails for good sites and if there are bad sites just give up after a certain period (press the panic button sorta thing). Thanks

    Read the article

  • Getting hover text with selenium in java

    - by BinaryEmpire
    I am trying to figure out how to get the product availability text from a page like http://www.walmart.com/browse/TV-Video/TVs/_/N-96v3? (once a store has been selected) I selected 76574 as my zipcode and went to the "In My Store" tab The code I have now is WebElement hoverElement = driver.findElement(By.xpath(".//*[@id='Body_15992428']/span")); WebElement hidden = driver.findElement(By.xpath(".//*[@id='slapInfo_NoVariant_15992428']/div")); Actions builder = new Actions(driver); builder.clickAndHold(hoverElement).build().perform(); System.out.println(hidden.getText()); **Edit: I tried profile.setEnableNativeEvents(false); and the text is now displayed in the automated browser window. I still cannot get to the text I want though. It does not throw an exception, only displays nothing because the driver thinks its still hidden. Any one know how to fix this? I keep getting Exception in thread "main" org.openqa.selenium.InvalidElementStateException: Cannot perform native interaction: Could not load native events component. Even after I do profile.setEnableNativeEvents(true); Are there any other ways I can get the hidden text, or what am I doing wrong here? Additionally while I was inspecting the code with firebug, I saw that there is this code <script type="text/javascript"> WALMART.$(document).ready(function(){ WALMART.$('#Body_15992428').hover(function(){ WALMART.$('#SeeStoreAvailBubble').wmBubble('update',WALMART.$('#bubbleMsgUpdate_15992428').html()); }); }); </script> I dont really know how to do things directly with javascript but is there is any way of getting the message text directly from that with a javascript executor?

    Read the article

  • Help needed wit the XPath statement for Selenium test

    - by mgeorge
    I am testing a calendar component using selenium.In my test i want to click on the current date.Please help me with the XPath statement for doing that.I am adding the HTML for the calender component <input id="event_date" type="text" on="click then l:show.event.calendar" style="border: 1px solid rgb(187, 187, 187); width: 100px;" fieldset="new_event" decorator="redbox" validator="date"/> <img id="app_136" style="position: relative; top: 2px;" on="click then l:show.event.calendar" src="images/calendar.png"/> <div id="app_137" style="margin: 0pt; padding: 0pt;"> <div id="app_calendar_2" class="yui-calcontainer single withtitle" style="position: absolute; z-index: 1000;"> <div class="title">Select Event Date</div> <table id="app_calendar_2_cal" class="yui-calendar y2010" cellspacing="0"> <thead> <tr> </tr> <tr class="calweekdayrow"> <th class="calweekdaycell">Su</th> <th class="calweekdaycell">Mo</th> <th class="calweekdaycell">Tu</th> <th class="calweekdaycell">We</th> <th class="calweekdaycell">Th</th> <th class="calweekdaycell">Fr</th> <th class="calweekdaycell">Sa</th> </tr> </thead> <tbody class="m6 calbody"> <tr class="w22"> <td id="app_calendar_2_cal_cell0" class="calcell oom calcelltop calcellleft">30</td> <td id="app_calendar_2_cal_cell1" class="calcell oom calcelltop">31</td> <td id="app_calendar_2_cal_cell2" class="calcell wd2 d1 selectable calcelltop"> </td> <td id="app_calendar_2_cal_cell3" class="calcell wd3 d2 today selectable calcelltop selected"> <a class="selector" href="#">2</a> </td> I want to click the date component described in <td id="app_calendar_2_cal_cell3" class="calcell wd3 d2 today selectable calcelltop selected"> <a class="selector" href="#">2</a> </td> Thanks in advance mgeorge

    Read the article

  • RSpec + Selenium tests for .NET on Windows

    - by John
    I'm a Rails developer doing TDD on a Mac with RSpec, Capybara and Selenium webdriver. Now I have been asked by my company to use this approach for a .NET on Windows environment. What is the best way of doing this? I could just install Ruby and use RSPEC, Capybara and Selenium webdriver for integration testing. But what about unit tests? I also looked at NSpec, but I'm not sure if I can combine that with Capybara or Selenium for integration tests. What would be a good approach here?

    Read the article

  • Selenium IDE - There was an unexpected Confirmation!

    - by Ula Krukar
    I have a button that displays Javascript confirmation popup. This is a part of my test case: <tr <tdclickAndWait</td <tdbuttonId</td <td</td </tr <tr <tdverifyTextPresent</td <tdObject has been deleted</td <td</td </tr It works as expected: OK is clicked automatically on a popup and verifyTextPresent return true. Still, I get [error] There was an unexpected Confirmation! in the log and test case fails. Any suggestions?

    Read the article

  • Maven Selenium HTTPS

    - by Walter White
    Hi all, I am testing my web application's security and all of my pages are served over ssl. The issue I am having is the certificate is not trusted as firefox starts in a new profile each time. I was reading on OpenQA's site about a jar and importing the certificate, but that is only for Internet Explorer and Firefox should automatically be handled. Is there anything special I need to do in order for certificates to automatically be trusted? Thanks, Walter

    Read the article

  • capybara selenium and JavaScript Destroy

    - by dorelal
    I am using rails 2.3.5 and this is what I did. I have latest cucumber, cucumber-rails and capybara installed. rails demo cd demo ruby script/generate cucumber --rspec --capybara ruby script/generate feature post title:string body:text published:boolean ruby script/generate scaffold post title:string body:text published:boolean rake db:migrate rake cucumber All the tests are passing. Now I want to test using Javascript. At this time this is how scenario looks like Scenario: Delete post Given the following posts: |title|body|published| |title 1|body 1|false| |title 2|body 2|true| |title 3|body 3|false| |title 4|body 4|true| When I delete the 3rd post Then I should see the following posts: |Title|Body|Published| |title 1|body 1|false| |title 2|body 2|true| |title 4|body 4|true| I added @javascript at the top. Now when I run rake cucumber then I see a confirmation page. But nothing happens until I click. What do I need to do so that OK is clicked automatically and test proceeds ahead.

    Read the article

  • Watir vs Selenium vs Sahi

    - by Dennis
    Out of these 3, which have you or has your company chosen to work with? Pros & Cons please. I'll be comparing them myself as well, but I'd like to hear what others have to say. Also, please state which you have all tried (so that I know you have a good comparison of the 3).

    Read the article

  • How to use Page Object pattern with Cucumber and Webrat / Selenium?

    - by Will Sargent
    I'm looking at a cucumber test suite that is somewhat brittle right now; many small steps, and no knowledge of the page itself. I'd like to factor out the logic involved in the step definitions inside a series of Selenium PageObjects. As seen here. However, because I'm using Webrat and not Selenium, everything has to go through the Webrat model. So I cannot do class MyPage < Selenium::WebPage end because that adds a direct dependency. So I have to route everything through Webrat while still maintaining the Selenium Page object goodness. No documentation on this that I can see: if someone has anything on Webrat + PageModel I'd love to see it.

    Read the article

  • Selenium Webdriver Java - looking for alternatives for Actions and Robot when performing drag-and-drop

    - by Ja-ke Alconcel
    I first tried Actions class and the drag-and-drop does work on different elements, however it was unable to locate the a specific draggable element on it's exact screen/webpage position. Here's the code I've used: Point loc = driver.findElement(By.id("thiselement")).getLocation(); System.out.println(loc); WebElement drag = driver.findElement(By.id("thiselement")); Actions test = new Actions(driver); test.dragAndDropBy(drag, 0, 60).build().perform(); I checked the element with it's pixel location and it prints (837, -52), which was somewhere on top of the webpage and was pixels away from the actual element. Then I tried using the Robot class and works perfectly fine on my script, but can only provide constant successful runs on a single test machine, running it with a different machine with different screen resolution and screen size will render the script to fail due to the dependency of Robot on the pixel location of the element. The sample code of the Robot script I'm using: Robot dragAndDrop = new Robot(); dragAndDrop.mouseMove(945, 166); //actual pixel location of the draggable element dragAndDrop.mousePress(InputEvent.BUTTON1_MASK); sleep(3000); dragAndDrop.mouseMove(945, 226); dragAndDrop.mouseRelease(InputEvent.BUTTON1_MASK); sleep(3000); Is there any alternative for Actions and Robot to automate drag-and-drop? Or maybe a help on working the script to work on Actions as I really can't use Robot. Thanks in advance.

    Read the article

  • How to get selenium to click on an object other than by ID

    - by Zombies
    So here is a little challenge. I have an image. It has 2 attributes: a random ID - not helpful an image url - but it is a button, and other buttons use the same image url, not helpful a CSS class - also used by too many other things to be helpful a style - neither helpful nor unique This image is however inside of an anchor tag, but the anchor tab isn't to a page, it just runs some javascript. Bellow is the html in question: <a id="template:j_id__ctru168pc2" title="Click for the Manual Class LOV" class="xei" style="text-decoration: none;" onclick="return false;" href="#"> <img id="template:j_id__ctru169pc2" class="xgs" style="border: 0pt none;" src="images/lov_ena.png"> </a> How can I click this image without using the ID?

    Read the article

  • Checking if an element is visible in Chrome using Selenium Remote WebDriver

    - by Stuart
    Is there a cross browser solution to check if an element is visible using WebDriver? The solution for IE and firefox is to cast the object to a RenderedRemoteWebElement and then call the property Displayed. I'm using the following methods to return if a element is visible: /// <summary> /// Check if the control is visible. /// </summary> public bool IsVisible() { IWebElement control = mSelenium.FindElement(mFindBy); return ((RenderedRemoteWebElement)control).Displayed; } The problem is when I run this using Chrome, I get an exception when casting to type RenderedRemoteWebElement, this is not really the problem as I can catch this, but I need to a solution to check if an element is visible in chrome. Thanks

    Read the article

  • Selenium navigation inside foreach loop

    - by smudgedlens
    I am having an issue with navigation. I get a list of rows from an html table. I iterate over the rows and scrape information from them. But there is also a link on the row that I click to go to more information related to the row to scrape. Then I navigate back to the page with the original table. This works for the first row, but for the subsequent rows, it throws an exception. I look at my row collection after the first time the link inside a row is clicked, and none of them have the correct values like they did before I clicked the link. I believe that there is something going on when I navigate to a different URL that I'm not getting. My code is below. How do I get this working so I can iterate over the parent table, click the links in each row, navigate to the child table, but still continue iterating over the rows in the parent table? private List<Document> getResults() { var documents = new List<Document>(); //Results IWebElement docsTable = this.webDriver.FindElements(By.TagName("table")) .Where(table => table.Text.Contains("Document List")) .FirstOrDefault(); var validDocRowRegex = new Regex(@"^(\d{3}\s+)"); var docRows = docsTable.FindElements(By.TagName("tr")) .Where(row => //It throws an exception with .FindElement() when there isn't one. row.FindElements(By.TagName("td")).FirstOrDefault() != null && //Yeah, I don't get this one either. I negate the match and so it works?? !validDocRowRegex.IsMatch( row.FindElement(By.TagName("td")).Text)) .ToList(); foreach (var docRow in docRows) { //Todo: find out why this is crashing on some documents. var cells = docRow.FindElements(By.TagName("td")); var document = new Document { DocID = Convert.ToInt32(cells.First().Text), PNum = Convert.ToInt32(cells[1].Text), AuthNum = Convert.ToInt32(cells[2].Text) }; //Go to history for the current document. cells.Where(cell => cell.FindElements(By.TagName("a")).FirstOrDefault() != null) .FirstOrDefault().Click(); //Todo: scrape child table. this.webDriver.Navigate().Back(); } return documents; }

    Read the article

  • selenium, get text from id

    - by user3766148
    on the following url - http://www.filestube.to/26frq-Buffalo-Clover-Test-Your-Love-2014-9Jai9TJFukAS9fq9sWngAD.html I am trying to copy the; Direct links: turbobit.net/9mrb0eu9eksx/26frq.Buffalo.Clover..Test.Your.Love.2014.rar.html via css path or xpath and unable to retrieve the information and store it to a variable. firebug gives me html body div.cnt div.rH.no-js.fd div.rl div.fgBx pre span#copy_paste_links but when I apply css=html.body.div.cnt.div.rH.no-js.fd.div.rl.div.fgBx.pre.span#copy_paste_links/text() to the target, I get error not found http://i.imgur.com/KdBmDHE.png

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >