Answered

Need help in automation related to theme colours

Initially, the circle cursor has a default white color as shown in below image with Xpath : //div[@style="position: absolute; top: -9px; left: -12px;" and @aria-valuetext="hsl(0, 0%, 98.82%)"]

To select the different color displayed in image suppose below image there is no Xpath for that color to use that as target Xpath to scroll to it or to select it when the default cursor is in the initial position i.e White color.
When Manually clicked on below image color, the Cursor moves to selected color in image and the Xpath gets updated to :  //div[@style="position: absolute; top: 81px; left: 163px;" and @aria-valuetext="hsl(0, 88.52%, 59.02%)"]
Hence not able to select the different colors from the given Theme image without any specific Target Xpath.
 
 
 
 
 
 
 
 
0
9 comments
Avatar
Joseph Hamdan

Hi Khushboo,

Do you have a test case we can use to take a look at this particular page/site ?

Regards,

Subject7 Team

0
Comment actions Permalink
Avatar
Joseph Hamdan

+Post has been moved to General Discussion

0
Comment actions Permalink
Avatar
Khushboo K Agarwal

Hi Joseph,

 

We do have a Testcase for this:

Testcase Name : UT_HCM_TA_R_073_Abilityto_rebrand_career_portal
 
Data Credentials : HCM_Recruiting_TA_R_73 
 
Please have a look. Thanks :)
0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Khushboo,

Thank you. We will take a look at this and get back to you as soon as possible.

Regards

Subject7 Team

0
Comment actions Permalink
Avatar
Jonathan Hotz

Hi Khushboo,

try next solution please:

1. Create locator with xpath //div[@class="oj-colorspectrum-spectrum"]

2. Create Execute_Javascript command, add locator from point 1 to arguments and put next javascript:

function clickOnElem(elem, offsetX, offsetY) {
var rect = elem.getBoundingClientRect(),
posX = rect.left, posY = rect.top; // get elems coordinates
// calculate position of click
if (typeof offsetX == 'number') posX += offsetX;
else if (offsetX == 'center') {
posX += rect.width / 2;
if (offsetY == null) posY += rect.height / 2;
}
if (typeof offsetY == 'number') posY += offsetY;
// create event-object with calculated position
var evt = new MouseEvent('click', {bubbles: true, clientX: posX, clientY: posY});
elem.dispatchEvent(evt); // trigger the event on elem
}

clickOnElem(arguments[0], 30, 40);

 

 

 

It will click on your color panel by offset (30, 40). You can adjust numbers as you want.

 

0
Comment actions Permalink
Avatar
Khushboo K Agarwal

Hi,


Initially by default , white color is the Theme color.So as per the Left hand side, the Right hand side also has White Color as shown in the below image.
 
After we select the different color on the Left Hand Side say red, the same color is replicated on the Right Hand Side as shown in the image below i.e red color.But on the Right Hand Side there are no color related attributes to find the suitable Xpath for Validating the Replicated Color Changes.
 
Please look at the images for more clarity
 
 
 
 
 
 
 
0
Comment actions Permalink
Avatar
Khushboo K Agarwal

Hi,

Any update on this?

Thanks :)

0
Comment actions Permalink
Avatar
Jonathan Hotz

Hi Khushboo,

after investigation we found only one idea how we can do it: put your div to canvas and get canvas pixel color at this coordinate - JS will allow it.

Unfortunately, we haven't finished adaptation yet to make JS ready to use for your site.

Do you want to try this idea yourself or you prefer if we finish with our investigation?

0
Comment actions Permalink
Avatar
Jonathan Hotz

Hi Khushboo,

any news regarding to my last comment?

0
Comment actions Permalink

Please sign in to leave a comment.