Posts

webdriver - selenium is trowing an error as element is not visble -

i have java script injection send text hidden inputbox. webdriver throwing error element not visible cannot interacted with. webelement tmpelement= driver.findelement(by.classname("cwd_input")); javascriptexecutor executor = (javascriptexecutor)driver; executor.executescript(("document.getelementsbyclassname('cwd_input') [0].click();"),tmpelement); tmpelement.sendkeys("t"); you can set value of input via js. code like: string scripttoexecute = "document.getelementbyid("mytext").value = 'new value';"; executor.executescript(scripttoexecute);

I tried using th:remove="all-but-first" in thymeleaf but it didn't work -

<td th:remove="all-but-first"> <span th:each="groups : ${userview.user.groupmemberships}"> <span th:text="${groups.group.name}"></span>; </span> </td> i trying display first 2 rows returned in th:each , tried displaying first row @ first , didn't work. how display first row , should if want display first 2 or 3 rows in th:each ? the attribute th:remove used removing prototyping generated tags. as example: <table th:remove="all-but-first"> <tr th:each="user : ${users}"> <td th:text="${user.name}">john apricot</td> </tr> <tr> <td>martha apple</td> </tr> <tr> <td>frederic orange</td> </tr> </table> this means remove second , third tr , leaving tr used iteration. more details here . so if want display first element o...

How to notify backing bean that JSF has completed rendering? -

i have boolean semaphore in managed bean denotes whether jsf page utilizes has completed rendering. default, value should false , once last bit of html has been rendered (or thereabouts), value should set true , never again, during lifecycle of bean, should go false. i suppose 1 way if have form have hidden input tied bean method sets value of semaphore true. however, there way accomplish without form? on per-view basis, use <f:view afterphase> that. <f:view afterphase="#{bean.afterphase}"> private boolean renderedonce; public void afterphase(phaseevent event) { if (event.getphaseid() == phaseid.render_response) { renderedonce = true; } }

ios - Get current webview URL and login -

i try current url because when put bad login in app, have login page displayed. don't want page displayed. so, use solution current url , if url http://www.example.com/account/login/ want create action. currently, when try solution, have null response. nsstring * currenturl = _loadscreen.request.url.absolutestring; if ([currenturl isequaltostring:@"http://www.example.com/account/login/"]) { nslog(@"warning"); } else { nslog(@"url %@",currenturl); <- return (null). } i use code auto-login users : nsstring *identifiant = [[nsuserdefaults standarduserdefaults] valueforkey:@"identifiant"]; nsstring *password = [[nsuserdefaults standarduserdefaults] valueforkey:@"password"]; if((identifiant) && (password)) { //configure url nsstring* host = @"http://www.example.com"; nsstring* complement = @"/account/login"; nsst...

javascript - How to give child process control of the terminal, in Node.js? -

i have node app run terminal ( node myapp.js ). app spawns child node process (via child_process.fork ). after happens, want exit parent process, , give child process control of terminal. right now, when exit parent, child process runs in background, , terminal goes bash. how can give terminal child process, doesn't go bash? look @ child_process.spawn options.detached in node.js docs. looking for: const spawn = require('child_process').spawn; const child = spawn(process.argv[0], ['child_program.js'], { detached: true, stdio: ['ignore'] }); child.unref(); //causes parent's event loop not include child in reference count, allowing parent exit independently of child, unless there established ipc channel between child , parent. node provides child_process module has following 3 major ways create child process. exec - child_process.exec method runs command in shell/console , buffers output. spawn - child_process.spawn launches n...

apache - htaccess 301 redirect rule for multiple query strings -

i want 301 redirect rule multiple query string make seo friendly url. internal url: www.example.com?p=54&p1=abc xyz&p2=xxx45767 , on. 301 redirect url: www.example.com/54-abc-xyz-xxx45767?p=54&p1=abc xyz&p2=xxx45767 so, redirect url must contain old query parameters too. first step check query_string parameters in question. if match found, redirect should occur. you can use following in /.htaccess file: rewriteengine on # check query string , capture parts rewritecond %{query_string} ^p=([^&]+)&p1=([^&]+)&p2=([^&]+)$ # if @ root of domain, redirect rewriterule ^$ /%1-%2-%3 [r=302,l] to make redirect permanent , cached browsers , search engines, change 302 301 .

sas ods - How can I create SAS html files with names corresponding to a dataset field -

i'm trying create file each record in sas dataset. have been able succesfully using sas ods output using "newfile=page" option , running proc report on dataset. problem i'm having results in gerneric, sequentially numbered file names (test, test1, test2, etc...). i'd name each file based on variable in dataset. in example below, i'd file names titled based on "seq_nbr" in dataset. ods html path = "c:\test\" file = 'test.html' contents = 'contents.html frame = 'frame.html' code = (url="c:\test\javascript.js") newfile=page; proc report data = test2 nowindows headline headskip; column tdate ttime created_by cmttext; seq_nbr; run; you need macro this %macro doit; proc sql; select count(*) :n test2 ; quit; %do i=1 %to &n; data _null_; if _n_=&i call symput('name',seq_nbr); run; proc export data=something outfile="&name"; r...