Webdriver.io for Android/IOS saucelabs - saucelabs

Im trying to run selenium webdriver.io in saucelabs for Android /IOS , but the scripts are failing in saucelabs what is the optimal configuration capabilities that are recommended ?

For Android:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "Samsung Galaxy S4 Emulator");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("app", "souce-storage:***.apk");
capabilities.setCapability("browserName", "");
capabilities.setCapability("deviceOrientation", "portrait");
capabilities.setCapability("appiumVersion", "1.5.3");
driver = new AndroidDriver<>(new URL(URL), capabilities);

Related

iframe content not loading in headless chrome

We have a an Automated suite that runs via Jenkins in a windows 10 machine (static slave). When executing we started encountering problems where in certain iFrames are not loading when running our scenario in headless mode via Jenkins. If we connect to the windows machine and execute the script in normal mode (with head) then it works completely fine. What could be the problem here ?
iframe:
<iframe _content-tfg-456="" heightadjustment="40" id="iframe-src" src="https://samplelink" style="height: 83.828px;"></iframe>
Chrome Driver options: (Added most of the options for debugging this issue)
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--test-type");
chromeOptions.addArguments("--lang=en_US");
chromeOptions.addArguments("--ignore-certificate-errors");
chromeOptions.addArguments("--disable-dev-shm-usage");
chromeOptions.addArguments("disable-popup-blocking");
chromeOptions.addArguments("disable-infobars");
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-setuid-sandbox");
chromeOptions.addArguments("--disable-notifications");
chromeOptions.addArguments("--verbose");
chromeOptions.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
chromeOptions.setExperimentalOption("useAutomationExtension", false);
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--screenshots");
chromeOptions.addArguments("--user-agent=Chrome/90.0.4430.93");
//chromeOptions.addArguments("--remote-debugging-port=9222");
chromeOptions.addArguments("--window-size=1920,1080");
Map<String, Object> chromePrefernces = new HashMap<String, Object>();
chromePrefernces.put("credentials_enable_service", false);
chromePrefernces.put("profile.password_manager_enabled", false);
chromeOptions.setExperimentalOption("prefs", chromePrefernces);
return new ChromeDriver(chromeOptions);

xamarin mqtt not subscriving to messages

I have an mqtt broker in an android APP. I can connect to it from my nodeMCU (microPython) and publish and check messages.
I created an android app using Xamarin. Forms and I create a MQTT client like this :
IMqttClient client;
string topic = "test/msg";
var configuration = new MqttConfiguration();
this.client = await MqttClient.CreateAsync("192.168.110.51", configuration);
this.client.Disconnected += (o, e) => Debug($"disconnection (at client level)! {e.Message} and {e.Reason} ");
var state = await client.ConnectAsync(new MqttClientCredentials(clientId: "tester"));
await client.SubscribeAsync(topic, MqttQualityOfService.AtLeastOnce);
client
.MessageStream
.Subscribe(msg => Debug($"Message received in topic"));
I created a button that does this :
var msg = new MqttApplicationMessage(topic, Encoding.UTF8.GetBytes("HELO"));
await client.PublishAsync(msg, MqttQualityOfService.AtLeastOnce);
I then test the whole environment and it happens that when I publish from Xamarin I can read the HELO at the MCU, but not from the Xamarin (that's subscribed to the channel) and If I publish from the nodeMCU I can read from other nodeMCU but NOT from the Xamarin.
I tried subscribing to "#" to listen to anything, anyhow nothing appeared.
Any suggestion ??
UPDATE 1:
I tested with MQTT.fx and I can read all messages outputted from both nodeMCU (python) and Phone (Xamarin) and I can also publish messages and nodeMCU (Python) will receive them whilst Xamarin will not notice :(

Windows 10 Universal App - Package doesn't work normally as debug mode

public async Task<List<Tip>> GetTips()
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://APIURL ");
request.Credentials = CredentialCache.DefaultCredentials;
WebResponse res = await request.GetResponseAsync();
StreamReader sr = new StreamReader(res.GetResponseStream());
string result = sr.ReadToEnd();
List<Tip> tips = JsonConvert.DeserializeObject<List<Tip>>(result);
return tips;
}
I am working on a project which need to consume an enterprise Web API(Https) and display the data on Win 10 live tile, it’s an UWP application.
But I found it only works when I ran it in IDE(Visual Studio 2015 debug mode) .
When I created a package for this app and run it by powershell for installation, request.GetResponseAsync method throws exception “The login request was denied”.
I tried to check Enterprise Authentication and Private Networks(Client & Server) options in Package.appxmanifest. But there was no effect.
Any idea how to make it work normally? Thanks.

Handling UntrustedSSLcertificates using WebDriver

I got stuck in handling UntrustedSSLcertificates using web driver in Java.
I created firefox profile like:
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);
I created firefox profile, added overridden certificate.
This is not handling SSL certificates.
Is there any other way to handle UntrustedSSLcertificates?
//Firefox example with URL www.google.com
FirefoxProfile profile=new FirefoxProfile();
profile.setAssumeUntrustedCertificateIssuer(false);
driver=new FireforDriver(profile);
driver.get("https://google.com");
Eventually I found solution for Untrusted SSLCertificates:
ProfilesIni allProfiles = new ProfilesIni();
System.setProperty("webdriver.firefox.profile","your custom firefox profile name");
String browserProfile = stem.getProperty("webdriver.firefox.profile");
FirefoxProfile profile = allProfiles.getProfile(browserProfile);
profile.setAcceptUntrustedCertificates (true);
webdriver = new FirefoxDriver(profile);

sample/tutorial of using selenium 2.0 web driver in .net?

is there any tutorial/sample for using selenium 2.0 web driver with .net ?
I've tried searching but could find only java, nothing about .net and selenium 2.0 web driver
The docs here has an example in C#:
http://seleniumhq.org/docs/03_webdriver.html
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium;
class GoogleSuggest
{
static void Main(string[] args)
{
IWebDriver driver = new FirefoxDriver();
//Notice navigation is slightly different than the Java version
//This is because 'get' is a keyword in C#
driver.Navigate().GoToUrl("http://www.google.com/");
IWebElement query = driver.FindElement(By.Name("q"));
query.SendKeys("Cheese");
System.Console.WriteLine("Page title is: " + driver.Title);
driver.Quit();
}
}
Download latest package: http://selenium-release.storage.googleapis.com/index.html
Try here: http://selenium.googlecode.com/svn/trunk/docs/api/dotnet/index.html
There is also documentation in the archive with .net bindings here: http://code.google.com/p/selenium/downloads/detail?name=selenium-dotnet-2.31.2.zip&can=2&q=label%3AFeatured
Hope it helps you

Resources