@@ -182,14 +182,14 @@ class InternalTypeError extends TypeError {}
182182 * @param params
183183 * @return {!Command } The transformed command to execute.
184184 */
185- function toExecuteAtomCommand ( command , atom , ...params ) {
185+ function toExecuteAtomCommand ( command , atom , name , ...params ) {
186186 if ( typeof atom !== 'function' ) {
187187 throw new InternalTypeError ( 'atom is not a function: ' + typeof atom )
188188 }
189189
190190 return new cmd . Command ( cmd . Name . EXECUTE_SCRIPT )
191191 . setParameter ( 'sessionId' , command . getParameter ( 'sessionId' ) )
192- . setParameter ( 'script' , `return (${ atom } ).apply(null, arguments)` )
192+ . setParameter ( 'script' , `/* ${ name } */ return (${ atom } ).apply(null, arguments)` )
193193 . setParameter (
194194 'args' ,
195195 params . map ( ( param ) => command . getParameter ( param ) )
@@ -252,7 +252,7 @@ const W3C_COMMAND_MAP = new Map([
252252 [
253253 cmd . Name . FIND_ELEMENTS_RELATIVE ,
254254 ( cmd ) => {
255- return toExecuteAtomCommand ( cmd , Atom . FIND_ELEMENTS , 'args' )
255+ return toExecuteAtomCommand ( cmd , Atom . FIND_ELEMENTS , 'findElements' , ' args')
256256 } ,
257257 ] ,
258258 [
@@ -272,7 +272,7 @@ const W3C_COMMAND_MAP = new Map([
272272 [
273273 cmd . Name . GET_ELEMENT_ATTRIBUTE ,
274274 ( cmd ) => {
275- return toExecuteAtomCommand ( cmd , Atom . GET_ATTRIBUTE , 'id' , 'name' )
275+ return toExecuteAtomCommand ( cmd , Atom . GET_ATTRIBUTE , 'getAttribute' , ' id', 'name' )
276276 } ,
277277 ] ,
278278 [
@@ -308,7 +308,7 @@ const W3C_COMMAND_MAP = new Map([
308308 [
309309 cmd . Name . IS_ELEMENT_DISPLAYED ,
310310 ( cmd ) => {
311- return toExecuteAtomCommand ( cmd , Atom . IS_DISPLAYED , 'id' )
311+ return toExecuteAtomCommand ( cmd , Atom . IS_DISPLAYED , 'isDisplayed' , ' id')
312312 } ,
313313 ] ,
314314
0 commit comments