Posts

How to check that a value is set on a dropdown box selenium java -

i have html code. thing option names contain lots of spaces until tags closed. <select name="auth" id="auth" size=1 onchange="updatepagestate()"> <option value="0">open system </option> <option value="1">wep </option> <option value="2">wpa </option> <option value="3">wpa2 </option> i want check option selected in dropdown box using selenium in java. code: try { webdriverwait wait = new webdriverwait(driver, 20); wait.until(expectedconditions.texttobepresentinelementvalue(((by.xpath("//select [@id='auth']/option['" + authen + "']"))), authen)); system.out.println("authentification correct"); } catch (exception x) { system.out.println("authentification incorrect"); x.printstacktrace(); } where "authen" variable read file corresponds options in dropdown box. i followin...

android - Use m2crypto to print certificate in apk -

i show android apk certificate information openssl command does. like $ openssl pkcs7 -inform der -in cert.rsa -print_certs subject=... -----begin certificate----- miiebzccau+gawibagiekkpncjanbgkqhkig9w0baqsfadcbsjepma0ga1uebhmg ... 5be3oowpt+mhkewxsei9r+s7tuwkp+wopjevmbmga1uecgwm6yer5bgx572r57uc -----end certificate----- at first used pycrypto , found not include x509 format. after trying m2crypto , output error like in [7]: x509.load_cert('cert.rsa', x509.format_der) --------------------------------------------------------------------------- x509error traceback (most recent call last) <ipython-input-7-821a670a1ab6> in <module>() ----> 1 x509.load_cert('cert.rsa', x509.format_der) /usr/local/lib/python2.7/dist-packages/m2crypto/x509.pyc in load_cert(file, format) 613 cptr = m2.d2i_x509(bio._ptr()) 614 if cptr none: --> 615 raise x509error(err.get_error()) 616 r...

SWIFT OSX NSBezierPath Linewidth property not working -

i using following code draw line graph on custom nsview for var index = 0; index < (datapointsarray.count - 1); index++ { nsbezierpath().linewidth = 20.0 nsbezierpath.strokelinefrompoint(datapointsarray[index], topoint: datapointsarray[index + 1]) } this snippet contained within function called drawrect() within custom view. the line draws correctly within coordinate system of view. however, line drawn @ same width (one pixel width) regardless of .linewidth setting (e.g., 5.0, 10.0, 20.0 etc) seems have no impact on line drawn). is able advise might creating issue me. haven't been able find previous question raises issue. nsbezierpath().linewidth = 20.0 the () means initializing new instance of class , set linewidth 20.0. should create variable , use draw path: var bezierpath = nsbezierpath() bezierpath.linewidth = 20.0 bezierpath.movetopoint(datapointsarray[index]) bezierpath.linetopoint(datapointsarray[index + 1])

java - Renaming Spring csrf token variable -

my application runs under portal application. both implemented in spring , both use csrf security. my need change how csrf token named in session, both tokens can work without conflicts. tried far creating token repository , trying change parameter name , session attribute name in security config class. final httpsessioncsrftokenrepository tokenrepository = new httpsessioncsrftokenrepository(); tokenrepository.setheadername("toolbiz-csrf-token"); tokenrepository.setparametername("toolbiz_csfr"); //tokenrepository.setsessionattributename("toolbiz_csrf"); when make request spring doesn't new setup much, , log produces following line: invalid csrf token found what should more? missing something? this worked me:- @configuration @order(securityproperties.access_override_order) public class optosoftwebfrontsecurity extends websecurityconfigureradapter { @override protected void configure(httpsecurity http) throws exception { htt...

java - How can i call jar API from javascript using node.js with more implementations steps -

i trying re-use code in different technology stack. let's say: have jar contatins followng class defination: package com.gallop; import java.io.file; import java.io.ioexception; public class generatefile { public void generatefile(string filename) { file file = new file(filename); try { file.createnewfile(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } } now, code exported filegenerator.jar. now, question how can use class inside filegenerator.jar create file using javascript. basically, have import generatefile class jar. have create instance of generatefile. using instance of generatefile, should able invoke method generatefile filepath parameter.

swift - load a different view controller or tableview depending on previous button pressed -

i new swift coding. being said, i'm looking transition "home page" tableview or new view controller once menu item has been selected. curious how go using 1 view controller/tableview loading contents inherited file based on selection made previous. example: home - chores @ home - chores @ work - chores @ school a selection of chores @ home selected, 1 segue prepared loads view controller downstream in xcode, loads content differently if had selected chores @ work. hope makes sense , thank in advance. if not mistaken, considered subclasses uiviewcontroller or uitableview??? you may needs see uitableview docs, can set different datasource depends on selection apple link docs https://developer.apple.com/library/ios/documentation/uikit/reference/uitableview_class/ and here simple tutorial follow http://www.codingexplorer.com/getting-started-uitableview-swift/

spring - Spock test - RESTClient: HttpResponseException: Not Found -

i want write test request when api returns 404. my test: def "should return 404 - object deleted before"() { setup: def advertisementendpoint = new restclient( 'http://localhost:8080/' ) when: def resp = advertisementendpoint.get( path: 'api/advertisement/1', contenttype: groovyx.net.http.contenttype.json ) then: resp.status == 404 } my error: 14:24:59.294 [main] debug o.a.h.impl.client.defaulthttpclient - connection can kept alive indefinitely 14:24:59.305 [main] debug groovyx.net.http.restclient - response code: 404; found handler: org.codehaus.groovy.runtime.methodclosure@312aa7c 14:24:59.306 [main] debug groovyx.net.http.restclient - parsing response as: application/json 14:24:59.443 [main] debug org.apache.http.wire - << "ba[\r][\n]" 14:24:59.444 [main] debug org.apache.http.wire - << "{"timestamp...