Search Results

Search found 5783 results on 232 pages for 'translation unit'.

Page 55/232 | < Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >

  • 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

  • How to prevent swallowing exceptions caused by unset expectations for a mocked object?

    - by Schultz9999
    I am looking for a way to modify catch block depending on if it's executed during the unit test run or not. The purpose is basically to detect/setup mock expectations which are swallowed because catch doesn't rethrow. I am using MSTest. One obvious thing is using preprocessor but I don't think it works. Especially if to use DEBUG define. There should be an easy way to detect that, shouldn't it? I must have been looking for something wrong because I couldn't find much info on that. try {...} catch(Exception) { Log(...); #if DEBUG throw; #endif }

    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

  • System.NullReferenceException with WhoCanHelpMe Unit Test

    - by tlum
    I'm working with a test project based on WhoCanHelpMe, which is based on Sharp Architecture, NHibernateValidator, etc. As its written the when_the_profile_tasks_is_asked_to_create_a_profile unit test creates the profile object and saves it without issue. Now the profile object is a CreateProfileDetails type that derives from their own ValidatableValueObject which inherits the IValidatable interface. The problem surfaces when my class is based on an Entity rather than their ValidatableValueObject. When the test is run a System.NullReferenceException because Validate() is null. I'm afraid that I'm at a loss to resolve this bad behavior. Does anyone have some suggestions to get to the bottom of this? Thanks, -Ted-

    Read the article

  • CruiseControl.NET Silverlight Unit Tests Interact with Desktop Windows Server 2008

    - by user292195
    Hi, Currently we have CCService running as a Domain account because the build scripts deploy to a network location. However this causes any unit tests that test the view to fail. Due to not being allowed to interact with desktop. I can change the CCService to run as local system which works however i loose network connectivity. I also have tried setting up a /interactive cmd.exe but this has been deprecated in Windows Server 2008. Any Ideas on this one? Thanks Jeremy

    Read the article

  • How to instantiate a Singleton multiple times?

    - by Sebi
    I need a singleton in my code. I implemented it in Java and it works well. The reason I did it, is to ensure that in a mulitple environment, there is only one instance of this class. But now I want to test my Singleton object locally with a Unit test. For this reason I need to simulate another instance of this Singleton (the object that would be from another device). So is there a possiblity to instantiate a Singleton a second time for testing purpose or do I have to mock it? I'm not sure, but I think it could be possible by using a different class loader?

    Read the article

  • Test Driven Development (TDD) with Rails

    - by macek
    I am looking for TDD resources that are specific to Rails. I've seen the Rails Guide: The Basics of Creating a Rails Plugin which really spurred my interest in the topic. I have the Agile Development with Rails book and I see there's some testing-related information there. However, it seems like the author takes you through the steps of building the app, then adds testing afterward. This isn't really Test Driven Development. Ideally, I'd like a book on this, but a collection of other tutorials or articles would be great if such a book doesn't exist. Things I'd like to learn: Primary goal: Best Practices Unit testing How to utilize Fixtures Possibly using existing development data in place of fixtures What's the community standard here? Writing tests for plugins Testing with session data User is logged in User can access URL /foo/bar Testing success of sending email Thanks for any help!

    Read the article

  • DomDocument::loadHTML() error during phpunit test execution

    - by ranhan
    I am currently trying to write some unit test against my zend framework controller. When I run the following code I receive this error: public function testListActionShouldContainListTable() { $this->loginToSystem(); $uri = $this->_uriBase . 'campaign/list'; $_SERVER["REQUEST_URI"] = $uri; $this->dispatch('/campaign/list'); $this->assertController('campaign'); $this->assertAction('list'); $this->assertQueryCount('#list',1); } CampaignControllerTests::testListActionShouldContainListTable DOMDocument::loadHTML(): ID alrt already defined in Entity, line: 36 This occurs using any of the assertQuery and assertQueryContains methods. I have searched around but am not really finding a good answer to why it won't allow me to find this html node or how to get around this error. Thanks in advance for any help!

    Read the article

  • Creating a System.Windows.Controls.Image throws an exception - how do I use the dispatcher to instan

    - by Scott Whitlock
    I'm running my unit tests on a piece of code that does the following in the test: Assert.IsNotNull(target.Icon); Inside the getter for the Icon property, I'm doing this: System.Windows.Controls.Image img = new System.Windows.Controls.Image(); That's throwing this exception: System.InvalidOperationException : The calling thread must be STA, because many UI components require this. I understand what that means, and I understand that I need to use the Dispatcher, but I'm a bit confused about how or why... this is a property of my ViewModel and I don't get any of these exceptions when running the application. Other info: this only started failing when I upgraded to .NET 4.

    Read the article

  • How to mock static member variables

    - by pkrish
    I have a class ClassToTest which has a dependency on ClassToMock. public class ClassToMock { private static final String MEMBER_1 = FileReader.readMemeber1(); protected void someMethod() { ... } } The unit test case for ClassToTest. public class ClassToTestTest { private ClassToMock _mock; @Before public void setUp() throws Exception { _mock = mock(ClassToMock.class) } } When mock is called in the setUp() method, FileReader.readMemeber1(); is executed. Is there a way to avoid this? I think one way is to initialize the MEMBER_1 inside a method. Any other alternatives? Thanks!

    Read the article

  • Stop MSVC++ debug errors from blocking the current process?

    - by Mike Arthur
    Any failed ASSERT statements on Windows cause the below debug message to appear and freeze the applications execution. I realise this is expected behaviour but it is running periodically on a headless machine so prevent the unit tests from failing, instead waiting on user input indefinitely. Is there s a registry key or compiler flag I can use to prevent this message box from requesting user input whilst still allowing the test to fail under ASSERT? Basically, I want to do this without modifying any code, just changing compiler or Windows options. Thanks!

    Read the article

  • Is there any way to generate a set of JWebUnit tests from an apache rewrite config?

    - by robbbbbb
    Seems unlikely, but is there any way to generate a set of unit tests for the following rewrite rule: RewriteRule ^/(user|group|country)/([a-z]+)/(photos|videos)$ http:/whatever?type=$1&entity=$2&resource=$3 From this I'd like to generate a set of urls of the form: /user/foo/photos /user/bar/photos /group/baz/videos /country/bar/photos etc... The reason I don't want to just do this once by hand is that I'd like the bounded alternation groups (e.g. (user|group|country)) to be able to grow and maintain coverage without having the update the tests by hand. Is there a rewrite rule or regex parser that might be able to do this, or am I doing it by hand?

    Read the article

  • is it a good idea to write tests for environments other than development?

    - by jcollum
    Let's say I have a (fairly typical) set of environments: PROD, UAT, QA, DEV. Is it a good idea to run your tests across all environments? Here's what I'm thinking of. I have a proc in SQL that my code depends on, I'll call it proc_getActiveCustomers. If that proc isn't present my app will go south real fast. So I write a test that checks for the existence of this proc in the database. Nothing new here. But when I then deploy my app to the QA environment, would I also want to have a test that checks that environment for the existence of proc_getActiveCustomers? I think this is a good idea but I've never heard much about testing in environments outside of development. Makes me wonder if there's some downside I'm not aware of. The direction that I'm going is to have a list of environments in code and then passing that environment into my unit test.

    Read the article

  • How do I set up gaeunit 2.0a with my Django app?

    - by J. Frankenstein
    I am trying to set up Google App Engine unit testing for my web application. I downloaded the file from here. I followed the instructions in the readmen by copying the directory gaeunit into the directory with the rest of my apps and registering 'gaeunit' in settings.py. This didn't seem sufficient to actually get things going. I also stuck url('^test(.*)', include('gaeunit.urls')) into my urls.py file. When I go to the url http://localhost:8000/test, I get the following error: [Errno 2] No such file or directory: '../../gaeunit/test' Any suggestions? I'm not sure what I've done wrong. Thanks!

    Read the article

  • How to access uploaded files in Ruby

    - by Jeff King
    I am trying use a Java Uploader in a ROR app (for its ease of uploading entire directories). The selected uploader comes with some PHP code that saves the files to the server. I am trying to translate this code to Ruby, but am stumped on this point: PHP has a very convenient superglobal – $_FILES – that contains a hash of all files uploaded to the current script via the HTTP POST method. It appears Ruby does not have a similar resource. Lacking that, what is the best way to access and save the uploaded files? I am using the JavaPowUpload uploader ( http://www.element-it.com/OnlineHelpJavaPowUpload/index.html ).

    Read the article

  • Business enum to DatContract Enum conversion in WCF

    - by chugh97
    I have an enum namespace Business { public enum Color { Red,Green,Blue } } namespace DataContract { [DataContract] public enum Color { [EnumMember] Red, [EnumMember] Green, [EnumMember] Blue } } I have the same enum as a datacontract in WCF with same values. I need to convert the Business enum to the DataContract enum using a translator. Hoe can I achieve this?

    Read the article

  • Russian-to-English Parallel Word Corpus?

    - by Cygorger
    Hi: I am looking for a simple Russian to English word corpus. It can be as simple as a csv that lists a russian word in the first column and the equivalent English word in the second. Any ideas where I can find such a thing? Does the NLTK toolkit have something like this? Thanks

    Read the article

  • How do i translate movement on the Canvas3D to movement in the virtual 3D world

    - by Coder
    My goal is to move a shape in the virtual world in such a way so that it ends up where the mouse pointer is on the canvas. What i have: -mouse position (x,y) on a Canvas3D object -Point3d object of where a pick ray starting from the Canvas3D viewport intersects with the first scene object. (point in 3D space of where i want to start the drag) What i want: -Some way to translate the Point3d's coordinates so that the initial point of intersection (the Point3d object) is always overlapping the the mouse position on the canvas (same as when i used the pick ray to determine what the user clicked on from the Canvas3D object). Thanks!

    Read the article

  • Tagging translated text correctly (tagging with lang="")

    - by toomanyairmiles
    A client has asked me to add some polish text to their website, not having much experience in this area, can anyone tell me which of the two 'lang' solutions below is correct (or offer an alternative):- Tag everything:- <div lang="pl"> <h2 lang="pl">Najlepszy ruch jaki zrobisz!</h2> <p lang="pl">Do przyszlych najemców:</p> <p lang="pl">Tutaj w SPS mamy bogate doswiadczenie na rynku najmu i wyszukiwaniu domu, który bedzie idealnym miejscem dla przyszlych lokatorów. Dla wielu moze to byc trudne i stresujace, dlatego my w SPS pomozemy Wam przejsc przez pole minowe zwiazane z najmem i uczynic ten proces najprostszym i najszybszym jak to mozliwe.</p> <p lang="pl">Jesli szukasz nieruchomosci obecnie lub w najblizszej przyszlosci prosimy o kontakt z naszym doswiadczonym , przyjaznym i pomocnym personelem, a my postaramy sie pomóc znalezc Ci idealne miejsce, które jest wlasnie dla Ciebie.</p> <p lang="pl">Wiec aby w latwy sposób wynajac zadzwon juz dzis.</p> </div> Just tag the div <div lang="pl"> <h2>Najlepszy ruch jaki zrobisz!</h2> <p>Do przyszlych najemców:</p> <p>Tutaj w SPS mamy bogate doswiadczenie na rynku najmu i wyszukiwaniu domu, który bedzie idealnym miejscem dla przyszlych lokatorów. Dla wielu moze to byc trudne i stresujace, dlatego my w SPS pomozemy Wam przejsc przez pole minowe zwiazane z najmem i uczynic ten proces najprostszym i najszybszym jak to mozliwe.</p> <p>Jesli szukasz nieruchomosci obecnie lub w najblizszej przyszlosci prosimy o kontakt z naszym doswiadczonym , przyjaznym i pomocnym personelem, a my postaramy sie pomóc znalezc Ci idealne miejsce, które jest wlasnie dla Ciebie.</p> <p>Wiec aby w latwy sposób wynajac zadzwon juz dzis.</p> </div>

    Read the article

  • Strange encoding when using PHP with translated text.

    - by The Rook
    I am using Google translate with PHP to translate text. 99% of the text comes back with the expected encoding. However, A few characters become malformed and appear to be encoded incorrectly. How can I account for this encoding using PHP? Hierdie is \u0026#39;n This is in afrikaans, but other languages are also affected.

    Read the article

  • Coding in Other (Spoken) Languages

    - by contagious
    Something i've always wondered, and I can't find any mention of it anywhere online. When a shop from, say Japan, writes code, would I be able to read it in english? Or do languages, like C, php, anything, have Japanese translations that they write? I guess what i'm asking is does every single coder in the world know enough english to use the exact same reserved words I do? Would this code: If (i < size){ switch case 1: print "hi there" default: print "no, thank you" } else { print "yes, thank you" } display the exact same as I'm seeing it right now in english, or would some other non-english-speaking person see the words "if", "switch", "case", "default", "print", and "else" in their native language? EDIT - yes, this is serious. I didn't know if different localiztions of a language have different keywords. or if there are even different localizations at all.

    Read the article

  • Database of common translated phrases for localization?

    - by richardtallent
    I'd like to localize my app into a few other languages, all of which I can barely order a drink in. Does anyone know of an online resource for translations of common software menu options, messages, etc. into other languages? Given the number of developers (both OSS and closed-source) that deal with localization, and the overlap of resource strings between, it seems like a pretty obvious fit for a wiki or open source package, but I can't seem to find anything like this. I could try to mine the Windows resource files or dig around in resource strings in robust OSS apps like Firefox, but I suspect I'm not the first person to think of this and surely there is a site that I'm just not finding yet. Update: since nothing exists like this that I could find, I started a feeble attempt at an open-source string library. It's just a boilerplate Google spreadsheet now, so if you want to contribute, please go here: http://www.xark.org/

    Read the article

  • Rails: translations for table's column.

    - by Andrew
    In rails application I have two models: Food and Drink. Both food and drink have a name, which has to be stored in two languages. How do I better realize translations for theese tables? First solution I realized was to replace name column with name_en and name_ru. Another solution is to encode with YAML hash like { :en => 'eng', :ru => 'rus' } and store yaml as a name. What would you recommend, assuming content is not static? Maybe there's good article?

    Read the article

  • Translate XSD element names to English

    - by Coov
    I have an XML Schema Definition file .XSD who's elements are in Spanish. I have an XML data file that is also in Spanish that matches the schema definition. I created a dataset from the xsd using xsd.exe and I'm loading the XML into the dataset. I want to translate the element names to English. I can think of two options off the top of my head. Either scrape the XSD & XML files and translate the elements prior to generating the dataset with esd.exe, or iterate the dataset after I have loaded it with the xml, and translate my objects. I do have a written document that provides the English names for every element name in Spanish. The problem is there are hundreds of elements and I was trying to avoid coding that manually. Getting precise translations is not that important, it just needs to be readable by an English speaking person. Here is an example of what an element may look like "Apellidos": <xs:element name="Apellidos" type="xs:string"/> that I will translate to "SirName": <xs:element name="SirName" type="xs:string"/> I'm looking for ideas and or opinions on a quick way to do this. It's a one time deal so I'm not working about it scaling or being functional for things other than this single xml file. I'll be taking this dataset and writing out a flat file for English speaking users to read.

    Read the article

< Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >