Thursday, December 10, 2020

Debug your WebDriver script easily by connecting to existing Chrome Browser


Step1:

Open Chrome browser using --remote-debugging-port

Step2:
Ensure you have correct chromedriver.exe downloaded which matches with your chrome browser version.

Step3:
Connect to this browser by writing a separate code for debug to handle browser

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setExperimentalOption("debuggerAddress","localhost:1234");

ChromeDriver driver = new ChromeDriver(chromeOptions);
..... 
......

Notes: You can set your application from where you want to test , and start from respective step.

In this example used port 1234 , you are free to use any available port in your system.


Wednesday, November 25, 2020

 

Highlight Element and Disable Highlight using JSExecutor

((JavascriptExecutor) driver).executeScript("arguments[0].setAttribute('style', arguments[1]);", element,"color: yellow; border: 5px solid red;");

((JavascriptExecutor) driver).executeScript("arguments[0].setAttribute('style', arguments[1]);", element,"");

 

QTP Jenkins Execution Issues & Solutions



Ensure that the respective machine have been installed with QTP license, without this we can't run tests.

Resolution 1:
Login to the execution system and try to launch QTP manually. This step helps to find out any issues with license.

Resolution 2: Check the service Uft4Winrt is available, if not restart the system.
Select Uft4Winrt service , go to properties , click 'Log On'
Select 'Local System account' radio button and Select 'Allow service to interact with desktop' checkbox.

Resolution 3: Check the below DCom Config settings.
From start command: type dcomcnfg to open the Component Services
Go to Component Services -> Computers->My Computer->DCOM Config->
Configure properties of each application entries listed below. Double click each one check the details under Tabs ‘Security’ and ‘Identity’.

List of Applications Names:

HP Unified Functional Testing
HP.QTP.Automation.Agent.AOMObjects.AutomationUpdateRunOptionsObject
QtpExtensionInterface
QuickTest Professional Automation
UFTRemoteAgent

In Identity tab > Ensure 'Interactive user' radiobutton is selected.
In Security tab > Access Permissions > Select 'Customize' radiobutton and Edit Button
Select Permissions to "Self' Ensure to select  'Allow' for both Local and Remote Access. 

Resolution 4: With above if issue is not resolved continue with below steps
UFT tried to launch with 32-bit , so need to update settings.

Use the command to open the DCOM
Go to CMD prompt and type the command: C:\WINDOWS\SysWOW64>mmc comexp.msc /32
DCOM window:
Console Root > Component Services > Computers >My Computer >DCOM Config >
Repeat Resolution3.

Resolution 5: There might be issue with Microsoft Excel too
Run->dcomcnfg->Go to Component Services -> Computers->My Computer->DCOM Config->Microsoft Excel Application->Right click->Identity Tab-> Select ‘The interactive user’-> OK.

Repeat the above if issue persist with C:\WINDOWS\SysWOW64>mmc comexp.msc /32

Resolution 6: Jenkins job might failed due to msxml3.dll 
Register using below steps
1.regsvr32 msxml3.dll hit enter
2. Should get the successful registration
3. Restart the system