Currently in my Selenium tests, I am utilizing JavaScriptExecutor as shown below:
IJavaScriptExecutor js = driver as IJavaScriptExecutor;
string Pixels = "600";
js.ExecuteScript("arguments[0].style='transform: translateX(600px);'", DatesSlider);
I want to substitute the hard-coded value 600 with a variable named Pixels in the JS script but I'm unsure how to accomplish this. Can anyone provide guidance on how to achieve this?