WebDriver mouseOver is not working properly with selenium grid - selenium-webdriver

My requirement is verifying Image Hover is working or not using Webdriver. In that image tag title value is changing when I mouseover on the image like below.
Normal: [img title="ASPIRIN" "src="http://img.med.com/pi/LNK01570.jpg" class="preview">
if i mouseover on that image:[img title="" "src="http://img.med.com/pi/LNK01570.jpg" class="preview">
So here I'm trying to compare title values to verify the image hover. I have written code for that and it is working fine when I execute the script without using Grid. But using Grid mouseOver is not working properly. Image tag values aren't being changed. Is there any issue with using Grid? I'm using FF17 and Selenium 2.28.0 and Selenium 2.25.0.
My code:
String strVal1 = driver.findElement(By.xpath("//table[#id='ref_priceimgtable']/tbody/tr[12]/td[4]/img")).getAttribute("title");
System.out.println(strVal1);
WebElement element = driver.findElement(By.xpath("//table[#id='ref_priceimgtable']/tbody/tr[12]/td[4]/img"));
Locatable hoverItem = (Locatable) element;
hoverItem.getLocationOnScreenOnceScrolledIntoView();
Mouse mouse = ((HasInputDevices) driver).getMouse();
mouse.mouseMove(hoverItem.getCoordinates());
String strVal2 = driver.findElement(By.xpath("//table[#id='ref_priceimgtable']/tbody/tr[12]/td[4]/img")).getAttribute("title");
System.out.println(strVal1+"Null Value");
In the above code strVal1 and strVal2 should be different.

String strVal1 =driver.findElement(By.xpath("//table[#id='ref_priceimgtable']/tbody/tr[12]/td[4]/img")).getAttribute("title");
System.out.println(strVal1);
WebElement element = driver.findElement(By.xpath("//table[#id='ref_priceimgtable']/tbody/tr[12]/td[4]/img"));
Actions mouseOver = new Actions(driver);
mouseOver .moveToElement(element).build().perform();
String strVal2 = driver.findElement(By.xpath("//table[#id='ref_priceimgtable']/tbody/tr[12]/td[4]/img")).getAttribute("title");
System.out.println(strVal1+"Null Value");
Have you tried this method for mouse over ? If you try this method means , have you called the method for firefox profile "profile.setEnableNativeEvents(true);" ? . the method is necessary to firefox to handle the mouse over in selenium .
Pls try this i think this works fine in grid too.

Related

Mapbox GL popup text is unselectable

The text in my popups is unselectable. I am able to close popups via click, etc., but when hovering the pointer over the text, the pointer remains as the hand icon, and never changes into the I-beam text selection icon. I've tried adding the popups a few different ways, to no avail:
//with visgl/react-mapbox-gl:
<Popup latitude={0.0} longitude={0.0}>this text is unselectable</Popup>
//via the regular api:
new MapboxGL.Popup()
.setLngLat([0.0, 0.0])
.setHtml(<h1>this text is also unselectable</h1>)
.addTo(map);
//this method that I copied from somewhere:
const placeholder = document.createElement('div');
ReactDOM.render(<h1>still unselectable</h1>, placeholder);
new MapboxGL.Popup()
.setDOMContent(placeholder)
.setLngLat()
.addTo(map);
In the Mapbox examples, their text is selectable. Any idea why mine isn't? Thanks.
I believe it will be difficult to get to the exact cause without a running example. Here are some ideas:
Use the same class they use in the examples for the content: mapboxgl-popup-content
Inspect the HTML and see if there isn't some sort of invisible layered element on top of your text. From the Browser DevTools, in the "Inspector" (Firefox) or "Elements" (Chrome) tab, by hovering the tags, you'll be able to see the bounding box of each rendered element like so:
Similar to the point before, check for the z-index CSS property in the rendered element to see if something isn't layering on top of your content
Lastly, there's also the cursor CSS property which you can use to force the cursor's appearance.

Extjs 3.4 how to change the tooltip of grid column header on Run time?

tooltip: dizionario.traduci("${GRCLI_SW_T_PERIODO}"),
This is my Sample Code, I am using Extjs 3.4.0 am trying to update the tooltip of grid column on runtime, I am using column.tooltip = "abc" it changes the tooltip config but on mouse hover I am not able to see updated tooltip
The case is normal and easy. Actually, if you change the tooltip from tooltip config of extjs you need to refresh your DOM
You just need to get grid first and then you get the column on which you want to change the tooltip.
Code:
gridColumn.tooltip = "updatedTooltip";
Then for refresh DOM you just do:
gridPanel.getView().updateHeaders();
Thank You :)

Automating CKEditor Combo Boxes using Selenium Webdriver

Following is the CkEditor I am trying to automate on my website:
CKEditor
I have automated clicking through the Bold, Italics, Subscript and Superscript buttons. However, the dropdown menu for Font color or Text style show up blank on the DOM as follows:
DOM for CKEditor
As you can notice, the span underneath the combo box element is empty. Thus any of the text color options available in the combo box do not show up on the DOM. How to automate clicking through various different text colors?
The issue is that at least this dropdown is inside an iframe. You have to switch context into that iframe before you can select something in the dropdown. The code below is working for me.
driver.findElement(By.cssSelector("a[title='Formatting Styles']")).click();
driver.switchTo().frame("cke_72_frame");
driver.findElement(By.cssSelector("a[title='Borderless Table']")).click();

Cannot handle action events on Labels?

I've dynamically created a horizontal scrolling list of labels (with icon and bottom text) within a container in a tab.
However, I cannot seem to bind any action to this Label - I want touch, long press, options(commands), drag, etc
If I use Button instead of Label, I cannot seem to use URLImage to grab the icon from a url and save it to storage and use that as the button icon. It always uses only the placeholder from:
Image img = URLImage.createToStorage(placeholder, counter+"_thumbnail", thumbnailURL, URLImage.RESIZE_SCALE);
How do I grab events on the Labels? Here is a snippet of how I'm adding the labels to the container:
Container c = StateMachine.instance.findFirstListContainer();
for(...){
Label l = new Label();
l.setText(title);
l.setIcon(img);
l.setUIID("listItem");
l.setTextPosition(2);
c.addComponent(l);
}
You should use a Button rather than a Label and invoke the setUIID("Label") method.
The reason why you didn't do this is a separate question/issue: https://groups.google.com/d/msg/codenameone-discussions/5HoDEFjB5II/5dc4iKuYNSYJ

Unable to set button icon with ImageDownloadService (EncodedImage)

I have an issue with ImageDownloadService. Below is my code. If I use a label, I can display the image downloaded from a server. But if I use a button, nothing is displayed. I have set the placeholder as the initial icon of the button. Please what am i doing wrong?
EncodedImage eImg = EncodedImage.findButton(f).getIcon();
Image i = URLImage.createToStorage(eImg, "MyStoredImage.jpg", "http://ImgURL.png", URLImage.RESIZE_SCALE);
//now set the ad image to downloaded image
findButton(f).setIcon(i);
If I used findLabel(f).getIcon() instead and findLabel(f).setIcon(i), the code would work but for Button it does not. Why is this?
Thanks in advance.
See the discussion in the Codename One forum here https://groups.google.com/d/msg/codenameone-discussions/05dLV771OV8/x-pEYngCrsEJ

Resources