How to execute Javascript via code
Posted: Wed Dec 06, 2017 11:36 am
Hi,
I'm currently testing a web application in which there is an impossibility to test a certain functionality by just 'clicking' it.
Therefor, the solution that can help is to execute the JS behind the button.
Now I'm struggling to have the JS executed.
When i first tried with:
webdocument webDoc = "/dom[@domain='ourdomain']";
webDoc.ExecuteScript("BcsCommon.app.blabla.instance.scripttoExecute(['Argument'])");
Ranorex replied :
The type or namespace name 'webdocument' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
Elsewhere i found that i needed the 'Microsoft Internet controls' reference.
I tried to add it, but now the error reads:
Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK. 2) Install Visual Studio 2010. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the "ToolPath" parameter of the task. (MSB3091)
Can anyone help please? I'm unable to install software to the machine as i'm not local admin for it.
I'm currently testing a web application in which there is an impossibility to test a certain functionality by just 'clicking' it.
Therefor, the solution that can help is to execute the JS behind the button.
Now I'm struggling to have the JS executed.
When i first tried with:
webdocument webDoc = "/dom[@domain='ourdomain']";
webDoc.ExecuteScript("BcsCommon.app.blabla.instance.scripttoExecute(['Argument'])");
Ranorex replied :
The type or namespace name 'webdocument' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
Elsewhere i found that i needed the 'Microsoft Internet controls' reference.
I tried to add it, but now the error reads:
Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK. 2) Install Visual Studio 2010. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the "ToolPath" parameter of the task. (MSB3091)
Can anyone help please? I'm unable to install software to the machine as i'm not local admin for it.