appium | python | ios | wait_activity function is not working in iOS - python-appium

I'm trying to use this Explicit wait instead of sleep(15)
self.driver.wait_activity(locators.skip, 15, .5)
But appium is complaining that this function is not implemented for iOS.
Which function should I use for iOS?

self.driver.implicitly_wait(15)
will solve all this issue, and if you're using a while loop, or try except, etc etc, you also need to use it inside those methods.
I used it in setup class and I need not to repeat the same code at every element.

Related

Is there way run uvm_sequences on ovm_agent?

We are in process to migrate our TB to UVM.
I am working on first IP that will be verified using UVM.
I have to find out if it is possible to reuse my uvm_sequences in SOC that remains in OVM mean time.
In case it is possible , like find example how it's done.
Thanks in advance.
You cannot mix OVM and UVM that way. You should be able to write your uvm_sequence in such a way that it work in both by simply changing your u's to o's. You would have to limit your sequence to functionality that exists in both.
If you use UVM RAL. there is a package that integrates that functionality back into OVM.
There is another package, ovm_container, that gives you the functionality of uvm_config_db.

How to run user code on server in different languages?

I would like to make an application simmilar to CodeFights in that a user is given a set of excercises for which he has to code solutions. I figured out how to take a users JavaScript code and run it on a Node.js server using for example the Function constructor:
try {
var solver = new Function('arg1', 'arg2', bodyAsString);
} catch(e) {
console.log('Function cannot be parsed');
}
Good thing about this approach is that the solver(...,...) function now has access to global scope only and not the scope it was made in. Even better one could also combine this with a sandbox module.
But what is the best approach if I want to use multiple languages - let's say JavaScript, Python and C++. How do I go about solving this problem if I want to give the user a choice of language? Do I write his solution to a file and try to execute it via command line also in some kind of a sandbox mode? Can this even be done if I use Node.js as backend?

CGEventCreateScrollWheelEvent in swift

Trying to figure out how to call CGEventCreateScrollWheelEvent from swift.
It looks like it's been removed from the docs:
Old docs: https://developer.apple.com/library/mac/documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html
New docs: https://developer.apple.com/library/prerelease/mac/documentation/Carbon/Reference/QuartzEventServicesRef/index.html
No word on what to replace it with. Anyone know another way to create a scroll wheel event?
According to the Swift devs, C variadic functions are not compatible with Swift variadics, so you won't be able to call it directly. The only workaround at this time is to write a non-variadic wrapper in C or Obj-C, and call that from Swift.

Difference between protractor locators

I was going through the protractor guide here: https://github.com/angular/protractor/blob/master/docs/api.md#api-protractor
It says in order to locate a element, I could use
var temp = element(by.css("someclass"));
or alternatively
var temp1 = ptor.findElement(protractor.By.css('someclass'))
Which kind of locator is to be used when ? Could someone pls clarify
They are the same. element is the preferred syntax because it is shorter and because you can chain locators and use some fancy protractor features. Protractor extends the webdriver api and that is why you can use the same functions that you would use in plain webdriver.
For example, the following expressions are equivalent:
ptor.findElement(by.css('.foo')).getText()
element(by.css('.foo')).getText()
$('.foo').getText()
To look for multiple elements use:
ptor.findElements(by.css('.foo'))
element.all(by.css('.foo'))
$$('.foo')
There are many examples in the api.md document:
https://github.com/angular/protractor/blob/master/docs/api.md#elementfinderprototypeelement
The difference between ptor.findElement and element is that the first should be used pages without Angular while the second is used on pages with Angular. This is related to how protractor syncs with Angular. The first returns a WebDriver WebElement, the second returns a Protractor ElementFinder.
However to address your question directly, there is no difference between the locators returned by by.css and protractor.By.css.
The two are equivalent. The object referenced by the global by object is the same as the the object referenced by protractor.By.
From Protractor's runner.js:
global.by = global.By = protractor.By;
There are two versions of the API. The old version used protractor.By, whereas the new version uses by. You may often see the old style but if you are in doubt, you can use the new style and be sure nothing unexpected will happen.

Is it possible to set matlab to validate reachable functions before running

Background
I am used to strongly typed, compiled languages so I'm used to misspellings being pretty much instantly picked up as undeclared variables.
However since Matlab is a weakly typed language this doesn't happen automatically and my development cycle tends to be:
write function(s)
|
˅
Run <-------------------------
| |
˅ |
Crash due to misspelling/typo |
| |
˅ |
Correct typo -----------------|
The run process can run for several minutes before getting to the typo, which slows down my development cycle considerably.
I'm using matlab version 2007b
Question
Is there any way to validate a function such that the use of non-existent variables etc are picked up without having to run the whole program? Given that each function has its own variable space it feels like this should be possible.
I am aware that is it possible to get a list of dependencies using depfun however I've not been able to find any way to validate those functions.
For example the following function will always fail but produces no warnings until it is run
function [biggest]=getBiggest(variableName1, variableName2)
if variablename1>variableName2, %<---misspelling!
biggest=variableName1;
else
biggest=variableName2;
end
end
I suspect that you are either using a different editor, or that you changed your warning preferences.
When going to home > preferences > code analyzer make sure you have the one enabled that contains something like:
cannot determine whether ... is a variable or a function
The MATLAB Linter will generally pick up variables that are used before being assigned (e.g. because it's a typo), but it isn't perfect. It is enabled by default (in R2011b, at least) in the GUI but can also be run outside of MATLAB: http://www.mathworks.com/help/matlab/ref/mlint.html
The Code Analyzer should catch most things like that.
Personally I would create some unit tests. I use xUnit, but there is a whole question dedicated to it: Unit-testing framework for MATLAB.
For sure it will catch syntax errors. In addition it helps checking the algorithm.