In this post I will provide some files and instructions that will allow you to create automated tests for the vSphere Web Client.
Important notes, before you start:
Summary
Enabling automation of a Flex application requires a number of libraries to be built in the application. The instructions and bits provided here will allow you to build you own customized copy of the vSphere Web Client.
Here is a summary of the steps that you need to perform to achieve this:
The provided script (pom.xml) will include the following Adobe libraries in the Web Client build:
There are instructions how to include the Selenium Flex API library. The dependency is added in the build script for you, but is commented out.
Additionally you can include any arbitrary Flex library you want in your customized build of the UI.swf. Look for instructions in the PDF document within the ZIP file.
Enjoy!
Hi Peter,
I am using vCenter Version 6.0.0 Build 2172318. I have downloaded "vsphere-webclient-automation-6.0.0.zip" and followed the below steps, as per mentioned in the document(Enabling Automated Testing for the vSphere Web Client.pdf)
Steps:
-----
1) Copied the C:\Program Files\VMware\vCenter Server\WebClient\plugin-packages\vsphere-client\plugins\container-app-war-6.0.0.war from vCenter machine to local machine(inside the extracted zip of vsphere-webclient-automation-6.0.0).
2) Uncommented Selenium flex <repository> and <dependency> in pom.xml and Executed the command mvn install
3) Now am able to see the modified "container-app-war-6.0.0.war".
4) Replaced the new "container-app-war-6.0.0.war" in vCenter machine of respective location.
5) Restarted the "VMware vSphere web client" service. Also I have tried to rebooted the vCenter machine
Able to see a only blank screen after logged into vSphere web client.
Kindly help me to resolve this issue.
Note:
If we again replace the old "container-app-war-6.0.0.war", I am able to view my home page of vSphere web client.
Hi Peter,
Thanks for your information.
Tried below steps through the link(https://communities.vmware.com/thread/520914) and the document provided.
- Upgraded existing Vcenter Server with Beta Version to version 6.0.0 Update1#build 3018524
- Build a Custom Version of the container-app-war-6.0.0.war through maven
- Replace the Original container-app-war-6.0.0.war File with Custom Version of the container-app-war-6.0.0.war
- Restarted VMware vSphere Web Client service.
Issue:
- Also unable to login to VSphere Web Client. The login page is getting reloaded
- Tried with developer tools and observed that there were no SFAPI library methods added and compiled
Notes:
- Rebooted the server machine for the VMware vSphere Web Client and other related services to get restarted
- Restarted virgo server for the changes to take effect
- Attached virgo.logs with this case
Details:
Vmware vCenter Server version : 6.0.0 Update1#build 3018524
Please let me know your thoughts on this
Many Thanks,
Thameem
@prmsvmprmsvm
The provided solution works for 6.0.0 GA (Web Client reports build 2559277).
Unfortunately as mentioned in the original post it is version specific.
Hi Thameem,
Also unable to login to VSphere Web Client. The login page is getting reloaded
You cannot login manually or through automation?
Can you try to clear the browser cache?
Tried with developer tools and observed that there were no SFAPI library methods added and compiled
Have you uncommented the following sections in the main pom.xml file:
<repository>
<id>Selenium-Flex-API-repo</id>
<url>http://sfapi.googlecode.com/svn/maven</url>;
</repository>
<dependency>
<groupId>com.googlecode</groupId>
<artifactId>sfapi</artifactId>
<version>0.2.6</version>
<type>swc</type>
<scope>internal</scope>
</dependency>
The code is there. Just needs to be uncommented.
Thanks,
~Peter
Hi Peter,
Uncommented below tags, cleared cache and tried already. But still the problem persists.
Many Thanks,
Thameem
Hi Peter,
I have followed the compilation steps against vCenter Server 6.0.0 Update 1 (Build:3040890).
I am not able to login the web-client by automation. But, able to logged in manually(able to view the home page without any issues).
Could you please help me to resolve this,
prmsvm
I am glad that at least the manual workflow is working
How did you login by automation in the previous Web Client versions? Did you use the special build provided by Laurent?
Thameemansari
Hi Themeem,
The same question to you:
Do you login using automation of manually?
Thanks,
~Peter
Hi Peter,
This is the first time automating the VSphere web client using selenium SFAPI library.
Is any other way to get compiled SFAPI library(container-app-war) for vCenter 6.0.0 update 1.
Please help me on this.
Thanks in advance.
Hi Peter,
Tried logging in manually, but in vain.
Got the custom build for vSphere 5.5.1 from Rahul Dey of VMWare.
Also able to do all the required operation using custom build including Login.
Many Thanks,
Thameem
Hi Peter,
Able to login through automation in custom build of vSphere 5.5.1.
But unable to login even through manually, after replacing container_app.war of vsphere 6.0.1
Many Thanks,
Thameem
Hi Peter,
Could you please tell me if there is any update/workaround on this.
Hi Thameem,
In 6.0 the login page has changed. Now it is no longer in Flex. If you inspect the browser element you will notice that the login page is in HTML.
This will require a change in your automation. And this is not related with the custom build.
Can you send me the compiled ui-swf.swf file? I will try it out to see why you can't login.
Thanks,
~Peter
Is any other way to get compiled SFAPI library(container-app-war) for vCenter 6.0.0 update 1.
No, there is no other way.
Where do you get stuck? At the login page? Please check my reply to Thameem.
Hi Peter,
The compilation of vCenter 6.0.0 update 1(VMware-VIMSetup-all-6.0.0-3040890 build) with SFAPI library got success. (In Home page using developer tools we are able to execute the command "container_app.doFlexType" is working).
Could you please help me how to identify the flex objects in VSphere web client.
Note:
1) I have tried using Monster Debugger tool to identify the flex objects, but it is unable to load VSphere web client in Monster Debugger tool application.
2) I have tried added "MonsterDebugger.swc" in pom.xml and get compiled container-app.war, but it is unable to load VSphere web client in Monster Debugger tool application.
Thanks in advance.
Hi Peter,
Good to go with installation of automation supported custom build for vCenter Server 6.0.0 Update1[Build#3018524] and able to automate components.
But facing the similar problem as another user replied in the forum i.e. Monster Debugger Tool is not identifying Vcenter Server 6.0 version.
Kindly let me know your thoughts on this.
Many Thanks,
Thameem
I am glad that it worked out!
Can you give me more details how what did you do:
Thanks,
~Peter