Posts

Featured post

selenium webdriver - I want to execute specific test cases say for Ex: TC5 and TC10 using TestNG? -

when have 10 automation test cases , want execute specific test case tc5 , tc10. how acheive using testng? from running tests in testng testng can invoked in different ways: command line ant eclipse intellij's idea with 4 links should able appropriate documentation whichever way want run. each 1 documents how run select methods, classes, packages, , groups. you can define testng.xml file includes/excludes methods/classes/packages/groups want run. e.g.: <!doctype suite system "http://testng.org/testng-1.0.dtd"> <suite name="partial-tc-suite"> <test name="tc5+tc10"> <classes> <class name="com.example.test.tc5"/> <class name="com.example.test.tc10"/> </classes> </test> </suite>

Javascript/Java - Webservice returning doubles for date.valueOf() -

i have javascript webservice returns array of timestamps using date.valueof(). but reason when android application gets results doubles! why happening? have confirmed array in webservice loaded non double values! valueof() returns primitive value of date object, double you're seeing date expressed in milliseconds since midnight 01 january, 1970 utc. known epoch time. if want date in other format, should @ documentation getfullyear, getmonth, , getdate, use construct string date. alternatively, java has calendar class has functions convert epoch time regular dates.

google chrome - Are GCM subscription IDs and instance IDs the same thing? (subscribe to topics via web) -

i'm trying set gcm html5 push notifications through chrome. want these subscriptions use topics, don't have maintain list of subscribed ids myself. however, of topic documentation can find refers subscribing through ios , android apis, not through web. i found documentation on relationship mapping makes seem can control topic subscriptions sending requests server, requires instance id. documentation i've been able find chrome web notifications talks subscription id. are same? i.e., send subscription id server, forward onto gcm server api? or instance id , subscription id 2 different things? don't same in examples provided (the instance id start xxxxxx:yyyyy) i'm concerned won't work. to answer own question: in fact 1 , same. unfortunately, seems topics not work chrome push notifications. api displays topic message being sent, browser never receives it.

python - Why does Pandas give me only one SettingWithCopyWarning? -

i have following code: import pandas pd import numpy np mydf = pd.dataframe({'uid':[1,2,3], 'price':[10,20,30], 'shipped':[2,4,6]}) grouped = mydf.groupby('uid').aggregate(np.sum) # call 1 mydf['price'].loc[:] = np.round(grouped['price'], 2) # call 2 mydf['shipped'].loc[:] = grouped['shipped'] the line have preceded call 1 executes no errors or warnings. line have preceded call 2 results in settingwithcopywarning error. why 1 result in error , not other? can in second call in order rid of error? my code executes fine, i'm tired on seeing 1 lone error every time run tests. no settingwithcopywarning error mydf['shipped'].values[:] = grouped['shipped']

rest - Defining an API with swagger: GET call that uses JSON in parameters -

i trying create proper, rest api, , document swagger (2.0). so, have api call query, ie, makes no changes , doesn't create (idempotent , safe). requires passing in complex json parameter (list of items, 2 or 3 sets of addresses, etc). i'm doing parameter thats url encoded json. seems proper way it. i see api's post reason, that's incorrect use of post verb. i'm seeing lots of swagger api's this... i can't figure out if there's way proper rest api swagger, using json parameter. can define parameter string, of course, , pass encoded json it, swagger tooling doesn't understand there's schema/definition it. is swagger not able document kind of call? i'm working on defining form parameters url-encoded json objects , facing same situation yours. thoroughly going through swagger specs tell not supported yet, required rest apis. also, can't define schema such object.

javascript - Method under test appearing in unit test other than in the action -

i wondering if give me pointers on designing unit tests, function being tested appears in test other in unit's action. i'm writing server side javascript node , using rsvp asynchronous calls restful backend. i structure unit tests follows. //setup //action //assertion //cleanup right now, i'm building function asynchronously deletes enteries in database unit test looks this. "deletingfunction_1entry_returns1entrydeleted": function() { return new rsvp.promise(function( resolve, reject ) { //setup var databaseentry = { "info": "info" }; setup( databaseentry ).then(function( xpostedentries ) { //if setup promise resolves then... //action xdelete( xpostedentries ).then(function( xdeletedenteries ) { //assertion if ( xpostedentries === xdeletedentries ) { //if posted enteries matched deleted enteries then... resolve(); ...

Removing repeated string in javascript -

i have problem 1 of string has repeated url inside , want remove it. what's best way in javascript? following example of string referring to. var str = " http://www.example.comhttp://www.example.com " one solution reassign str half of itself. str = str.substring(str.length/2) (this assumes string follow same format example gave.)