Hi team,
I’m working on E -commerce application in that I need to Invoke the C# code for Browser Zoom size as 67%
I’m using this code
// Create a UiPath browser activity with Invoke Code and use the following code
// Inject JavaScript to change the zoom level
string jsZoomScript = “document.body.style.zoom=‘67%’”;
// Use UiPath’s Inject JS Script activity or invoke JavaScript directly
UiPath.Core.Activities.InjectJsScript injectScript = new UiPath.Core.Activities.InjectJsScript
{
ScriptCode = jsZoomScript,
Browser = browser, // Replace with your browser variable
InjectType = UiPath.Core.Activities.InjectJsScript.JsInjectType.Page
};
// Execute the activity
invokeCodeActivity.Execute(injectScript);
but it’s not working. it returning the below error messages
NewActivity.xaml: No compiled code to run
error CS0117: ‘InjectJsScript’ does not contain a definition for ‘Browser’ At line 9
error CS0103: The name ‘browser’ does not exist in the current context At line 9
error CS0117: ‘InjectJsScript’ does not contain a definition for ‘InjectType’ At line 10
error CS0117: ‘InjectJsScript’ does not contain a definition for ‘JsInjectType’ At line 10
error CS0103: The name ‘invokeCodeActivity’ does not exist in the current context At line 14
Can you anyone help me this code.
it’s really helpful to me.
Regards,
Saikrishna






