Ask a Question

Exceuting Custom JS

SOLVED
K_Sathish_Kumar
Contributor

Exceuting Custom JS

Hi team,

I am trying to write a custom JS to find elements which are inside an iframe parent using xpath, but im facing some problem  at the last line where I am trying to evaluate the xpath within "contentDocument.Script.eval" .

requesting you to please help me know how to fix the same.

 

Code Snippet:

function CustomJStoFindObj(){
  identifier = eval('"//input[@id=\'f2b06437___form_menu_form_name\']"')
  test = 'document.evaluate("' +identifier+'",document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;'
  Log.Message(test.toString());
  temp = test.toString();
  var pageObj = Sys.Browser("chrome").Page("URL")
  var Obj = pageObj.contentDocument.Script.eval(temp)
}

 waiting for your valuable reply.

 

Thanks in Advance 

Regards,
Sathish Kumar K
1 ACCEPTED SOLUTION

Accepted Solutions
sonya_m
Community Manager

Re: Exceuting Custom JS

Hi @K_Sathish_Kumar !

 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

3 REPLIES 3
sonya_m
Community Manager

Re: Exceuting Custom JS

Hi @K_Sathish_Kumar !

 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

K_Sathish_Kumar
Contributor

Re: Exceuting Custom JS

Hi @sonya_m ,

 

Thank you very much, it helped me a lot to find out the solution.

 

Regards,
Sathish Kumar K
sonya_m
Community Manager

Re: Exceuting Custom JS

@K_Sathish_Kumar You are welcome! I am really glad this was helpful🙂


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: