How to perform triple tap on element in appium 1.6 - appium

I am trying to achieve a triple tap action on an element(IOS) less than 2 seconds using appium 1.6, tried below code but it is throwing an error.
new IOSTouchAction(driver).Tap(ele).Tap(ele).Tap(ele).perform();
Or:
for (int i = 0; i < 3; i++)
{
new IOSTouchAction(driver).tap(element).perform();
}
But no use.
Appium: 1.6.3
JavaClient: 5.0.0-BETA5/4.1.2
Please let me know if anyone has achieved this using above specs, thanks in advance.

The problem here is not with your code but with apple's Instruments.
It's a known issue that Instruments is forcing a 1 second delay between each action. to solve this try and configure "Instruments without delay". it worked for me!
https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/iwd_xcode7.md
After configuring this, i believe that your "for" loop will work as expected

Related

How do i automate scroll in chrome using AndroidDriver?

Trying to automate the hamburger menu in a android emulator on a pixel device. I am using Appium and automating with the android driver. I see that scrollTo() is deprecated does anyone know how to go about this?
Just use this simple command for scrolling in appium using DesiredCapabilities in JAVA.
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector()).scrollIntoView(text(\"Your Text\"));");
Hope this helps
So the quick answer to this is, no there is no new way. This is to my understanding because UIAutomator2 does not allow elements that are not on the screen to be found by Appium's driver. UIAutomator2 is required for automating devices on Android version 7 and high I believe.
This means that there is no way to tell which direction the element is when it is off screen. So if anyone has a solution to this I'd be happy to hear it.
Now depending on what kind of app you are automating it is possible to fake swiping to an element if you know what direction it is in. For example if your app only scrolls up and down (like many apps) then as long as you know if the element is below or above your current position you can swipe to it. This can be done with a while loop:
while(elementNotFound) {
if(findElement(byLocator)) {
elementNotFound = !elementNotFound;
}
else {
// This is where you would swipe in the direction of where the element is
}
}
The new way of swiping is to use the TouchAction class. For example you can do:
(new TouchAction<>(driver)).press(PointOption.point(startX, position.startY)
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(1000)))
.moveTo(PointOption.point(endX, endY))
.release()
.perform();
Alternatively you can use the deprecated swipeTo method with UIAutomator drive type (not UIAutomator2). Again to my understanding this will only work for devices on lower Android SDK versions.
Sorry if this doesn't give you the answer you are looking for but hopefully it at least gives you a way to find your element.
With latest Appium Java client 6.1.0, you can swipe using the following code,
new AndroidTouchAction (driver)
.press (PointOption.point (startX, startY))
.waitAction (WaitOptions.waitOptions (Duration.ofMillis (1000)))
.moveTo (PointOption.point (endX, endY))
.release ()
.perform ();
Here startX, startY, endX and endY needs to be calculated as per your needs.
OR
You can even use my open source framework Coteafs-Appium v-3.0 to swipe like,
SliderActivity slide = new SliderActivity (this.androidDevice);
slide.onElement ("Slider")
.swipe (SwipeDirection.RIGHT, SwipeStartPosition.LEFT, 75);

TTSPlaybackCreate unable to initialize dynamics: -3000 Error

My Obj-C application using text to speech start to get [TTS] TTSPlaybackCreate unable to initialize dynamics: -3000 error I have no idea why is that happening means I checked internet and application code if there was an answer to this problem but could not find any.
Seems to be a new iOS version bug but it is been a long time that this error started and there is no solution yet.
A development has been since I asked that question. I am still unable finding the reason why I am having this message but I am able to make it speak now. utterance.preUtteranceDelay was 0.1
utterance.preUtteranceDelay = 0.1;
When I remove that setting or make the value 0.
utterance.preUtteranceDelay = 0;
[synth speakUtterance:utterance];
Makes the speech.

.or query in parse unity crashes on iOS

I'm doing a .or query which in every platform works fine except in iOS.
As soon it reaches the line where it does the .or, it crashes with:
System.Collections.Generic.List> doesn't implement interface System.Collections.Generic.IEnumerable>
Assertion: should not be reached at mini-trampolines.c:183
Here's the code:
var isChallenger = ParseObject.GetQuery("Match")
.WhereEqualTo("Challenger",fb.loggedUser);
var isChallenged = ParseObject.GetQuery("Match")
.WhereEqualTo("Challenged",fb.loggedUser);
ParseQuery<ParseObject> query = isChallenger.Or (isChallenged); // Crashes here.
I'm doing it just like in the docs, not sure what's wrong.
Any help would be much appreciated!
Thanks,
Pablo
I think this is a bug I reported here: https://developers.facebook.com/bugs/750897958275392/
Except, I only saw this bug when using ParseQuery. The workaround I used is to use ParseQuery only, but I see you're already doing that. Is the code you posted exactly the same as the code you're actually using?

App used to work with AIR 3.2, doesn't work with AIR 3.5

I'm getting this error when I press a button in a flash/air app that used to work in the AIR 3.2 SDK - now upgraded to the AIR 3.5 SDK. Any help much appreciated.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at seed_template_fla::MainTimeline/frame7()[seed_template_fla.MainTimeline::frame7:31]
at flash.display::MovieClip/gotoAndPlay()
at seed_template_fla::MainTimeline/gotoPage() [seed_template_fla.MainTimeline::frame1:20]
at seed_template_fla::MainTimeline/gotoRepro() [seed_template_fla.MainTimeline::frame1:12]
I'm creating an app for iPhone using Flash CS6 on Mac and exporting using the Air 3.5 SDK. I also have the AIR 3.5 runtime installed.
The app is very simple at the moment. It basically moves from frame to frame when you press a button using the gotoAndPlay(frameNr) function. There are some hexes on the frames that update an array of numbers when clicked. They are also toggled visible/not visible.
This used to work perfectly using the AIR 3.2 SDK, but I recently downloaded the AIR 3.5 SDK from adobe and added it through flash (Help>Manage Air SDK) and set it as the build target in File>Publish Settings>Target.
When I switch back to AIR 3.2 SDK, the app works perfectly again.
Also, when I upload the app to my iPhone 4S running IOS 5.1 using AIR 3.5 SDK, I just see a black screen with 5 loading dots flashing. This also works fine with AIR 3.2 SDK.
This is the code for frame 7
The last line is line 31.
stop();
techtitle.text = "Select Trait";
techdesc.text = "Spend points to change core stats and other special abilities";
points.visible = false;
techpoints.visible=false;
pointsbalance.text = myPoints.toString();
btn_tech.visible = false;
curTechSelected = null;
trace("set hexes invisible");
for (var j:int = 0; j <= 67; j++) {
if (hexStatusb[j] == 1) {
this["btn_hex_"+j+"b"].visible = false;
}
}
function onBtnHex37bClick(event:MouseEvent):void
{
techtitle.text = "tech1";
techdesc.text = "tech1 description"
techpoints.text = "-2";
points.visible = true;
techpoints.visible=true;
btn_tech.visible = true;
curTechSelected = btn_hex_37b;
curTechSelectedNr = 37;
curTechPoints = 2;
}
trace(this["btn_hex_37b"]);
btn_hex_37b.addEventListener(MouseEvent.CLICK, onBtnHex37bClick);
OK - so, after trying out lots of things, I figured out why this is happening.
Solution: get rid of all TFL text objects when running AIR 3.5 SDK
It seems that the TFL Text library wasn't being loaded properly at runtime. Something crucial that I neglected to mention was that I was getting this warning message (similar here http://forums.adobe.com/thread/825637)
Content will not stream... The runtime shared libraries being preloaded are textLayout_1.0.0.05... TFLText
and this warning message in the output
Warning: Ignoring 'secure' attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml. The 'secure' attribute is only permitted in HTTPS and socket policy files.
Simply removing all TFLText objects and changing them to classic text makes the app work fine again.
#csomakk Great news. I have found the answer. You can publish in 3.5 and 3.6 and have your TLF Text too. I posted a write-up on my blog that shows exactly how to do it.
To get started: the error message states that something is null.. it means, that the program doesn't know, where to look for it. It can happen, when you didn't create the object (btn_hex_37b = new MovieClip()); or you haven't even created a variable for it.
on the given line (btn_hex_37b.addEventListener(MouseEvent.CLICK, onBtnHex37bClick);) only btn_hex_37b can be null, because onBtnHex37bClick exists, and if it wouldn't, the program wouldn't compile.
The reason it came up when switching to AIR 3.5 is probably that it calls some creation functions in different order. Go to the line where you define the btn_hex_37b variable. Search for that functions calling.. Make sure, that btn_hex_37b is created before going to frame7.
Also, if its not a vital, to have onBtn_hex_37bClick, you can do the following:
if(btn_hex_37b){
btn_hex_37b.addEventListener(MouseEvent.CLICK, onBtnHex37bClick);
}
the if will check if btn_hex_37b is not null.
On the else method, you can give a timeouted method(but that is ugly), or give the eventlistener right after the creation of the object.
Hope this helped.
For Flash CS6, copy this swc:
/Applications/Adobe Flash CS6/Common/Configuration/ActionScript 3.0/libs/flash.swc
Into my Flash Builder project using these steps:
http://interactivesection.files.wordpress.com/2009/06/include_fl_packages_in_flex_builder-1.jpg
and then use this link
http://curtismorley.com/2013/03/05/app-used-to-work-with-air-3-2-or-3-4-doesnt-work-with-air-3-5-or-3-6/#comment-241102

How to get a list of background processes on BlackBerry

I'm looking for something corresponding to net.rim.device.api.system.ApplicationManager.getVisibleApplications(), but including applications that might not/do not have a UI. Any ideas?
Unreasonably complicated work-around solutions welcome, I'm growing slowly more sure that there's not a simple single call to do this...
If you know the application name you can detect if it is running or not by checking the size of the array containing all AppDescriptor actually running this app.
int codeModuleHandle = CodeModuleManager.getModuleHandle(applicationPackageName);
if (codeModuleHandle != 0) {
ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(codeModuleHandle);
}
You could imagine a code to get all installed application and then check

Resources