TestProject Forum

JavascriptExecutor - Record

Hello Team

I need your help. I want to create a step using JavascriptExecutor througt the record mode, but i don’t know how do that. I have the code in java and it works in my script (Java, selenium, eclipse). The code is the follow:

JavascriptExecutor js = (JavascriptExecutor) driver;

Long v = (Long) js.executeScript(“return Object(bookingData).TotalAncillary”);

Thanks and regards

Hello @edsoncorvo7
You can run this action:
image

The return value is in the output parameter.

Hello @ran.tzur

I did the test as follows

The result was successful

Thank you