I am trying to click a pin I have on my application which uses Bing Maps V8. The pins which are placed on to the map do not appear in the DOM elements as they are directly rendered onto the Map by Bing Maps engine.
I was wondering is there a way I can tell Testcafe to click an X Y value - for example
testController.click(718,962);
The above X Y value is from Selenium's IDE test recorder
Many thanks for any help
Please use the Click action with offset to click a point on an area. For example:
t.click('body', { offsetX: X, offsetY: Y })
// or t.click('img', {offsetX: X, offsetY: Y})
Related
I'm using Oculus Go controls (touchpad + trigger) in my WebXR molecular viewer (pure JavaScript + WebGL + WebXR) at https://www.ibiblio.org/e-notes/webxr/mini.htm. To migrate from Go to Quest I'd like to know, what corresponds to "selectend event" and "xrSession.inputSources[0].gamepad.axes[0/1] on Quest?
On the Quest thumbstick is exposed as
xrSession.inputSources[0/1].gamepad.axes[touchpad X, touchpad Y, thumbstick X, thumbstick Y]
where 0/1 correspond to the right/left hands. Therefore axes[2,3] should be used (instead axes[0,1] on the Go) to get X,Y coordinates.
See e.g. https://www.ibiblio.org/e-notes/webxr/mini/micro3q.htm.
React-native-maps supports custom tile overlays with UrlTile component. They are using Google maps and OSM style tile numbering, where 0, 0 is upper left corner.
Is there possibility to use TMS tiles, where 0, 0 refers to lower left corner (y-axis is reversed)?
I got no other idea than writing server-side proxy, which would parse x,y,z out from URL, reverse y and curl tile from Tile server with correct URL.
I ended up with patching AirMapUrlTile.java, I added new substitution for variable 'yr' (standing for y reversed).
String s = this.urlTemplate
.replace("{x}", Integer.toString(x))
.replace("{y}", Integer.toString(y))
.replace("{yr}", Integer.toString((1<<zoom) - y - 1))
.replace("{z}", Integer.toString(zoom));
This allows usage of urlTemplates like http://my.tms.server.com/layer/{z}/{x}/{yr}.png
But it would be nice to have some official solution for that, though.
You can try <UrlTile urlTemplate="..." flipY={true}.
I have tried a lot in finding out how measure the coordinate of an element in a web page in different browser.But I could not find any solution.
Is there any other tool that can measure the position of an element in various browsers???
In AutoIt you can use the following code to get screen coordinates (in my example for displaying a tool tip as an overlay on an Internet Explorer):
$oIE = _IECreate("http://...URL...")
$username = _IEFormElementGetObjByName(_IEFormGetObjByName($oIE, "loginform"), "username")
ToolTip("Login", _IEPropertyGet($username, "screenx"), _IEPropertyGet($username, "screeny"))
_IEAction($username, "focus")
Alternatively you can use _IEGetObjById($oIE, "mx77") to get an object reference. Or run through all all elemnts by tag name as shown here.
Instead of getting the absolute screen position, you can get the In-Browser-Position, using
browserx and browsery.
I have some mathematical formulas of the type
p = (l + m + n) / (i+j*2)
Note: This is just an example. The real equations are more complicated with several variables participating in the equations.
I want to display these formulas in a tree like structure in an interactive, rich web component.
Initially the screen should display
p = x/y
with p, x and y as boxes. The user can click on the box labeled x which will "unfold" the box to expand and display
x = (l + m + n) and so on.
Since this is a J2EE based application, I can use any RIA library compatible with J2EE.
Are there any 3rd party RIA libraries out there that can help me render these formulas?
Looks like MathOverflow has this down... check it out.
please see the below links:
http://www.math.union.edu/~dpvc/jsMath/examples/Henrici.html
http://www.myphysicslab.com/web_math.html
http://amaya.software.informer.com/11.1/
http://en.wikipedia.org/wiki/MathML
There are some buttons and menus in the application I am testing that require actual clicks to send all the information through and FireEvent style clicking does not seem to cut it. Both TestPartner and QTP can use actual clicks. TestPartner does this always (slow) and QTP does this by changing the 'ReplayType' to 2 from 1.
Setting.WebPackage("ReplayType") = 2
So my question is. Is there anyway to get real clicks in WatiN or Selenium? I have not been able to find that option.
Thank You,
Josh
Selenium 2 can fire real clicks instead of trying to synthesize the clicks and keystrokes like Selenium 1 does. It does a lot of interaction with the OS to do these things natively which over comes a lot of the Selenium 1 issues like is it firing a click or mouseup or mousedown?
Selenium 2 is in its 2nd alpha phase and is quite stable at the moment. You can get Selenium 2.0a2 from http://code.google.com/p/selenium/downloads/list.
I have been working on the .NET bindings and am really happy with the way they are going.
When ReplayType is set to device (2), QTP actually moves the mouse and performs a click (you can see the mouse cursor move). I'm not very familiar with Selenium but from what I know replay is done in pure JavaScript therefore it can fire DOM events (as QTP does in event ReplayMode) but it can't simulate a real click the way QTP does.
With WatiN, it is possible to get to the "native" interface of elements in IE windows. Using that you can get the screen coordinates of any element.
using mshtml; //Add a reference to Microsoft.mshtml that comes with WatiN.
using WatiN.Core.Native.InternetExplorer;
public static System.Drawing.Point GetScreenPoint(IEElement element)
{
IHTMLElement nativeElement = element.AsHtmlElement;
IHTMLElement2 offsetElement = (IHTMLElement2)nativeElement;
IHTMLRect clientRect = offsetElement.getBoundingClientRect();
IHTMLDocument2 doc = (IHTMLDocument2)nativeElement.document;
IHTMLWindow3 window = (IHTMLWindow3)doc.parentWindow;
int windowLeft = window.screenLeft;
int windowTop = window.screenTop;
int elementLeft = clientRect.left;
int elementTop = clientRect.top;
int width = nativeElement.offsetWidth;
int height = nativeElement.offsetHeight;
int clickX = windowLeft + elementLeft + (width / 2);
int clickY = windowTop + elementTop + (height / 2);
return new System.Drawing.Point(clickX, clickY);
}
To use it:
Button myButton = browser.Button(Find.ById("myButton"));
System.Drawing.Point clickPoint = GetScreenPoint((IEElement)myButton.NativeElement);
MyClick(clickPoint);
Obviously the element has to be visible. I don't know how to check for that offhand, but I think you can change the scrollTop and scrollLeft attributes of the body to scroll around.
You'll also need a method to actually do the click, but there's probably an answer for that already on stackoverflow.