Does anyone know why my message is not showing in Logcat - kotlin

I have this code in main
val password = R.id.registerPassword.toString()
Log.d("Message", password) // password = "12345"
but i cant find this message in Logcat
I tried to reset the software, I have also tried to change some setting for Logcat there was no result.

Related

How to change toast message's default icon in jetpack compose?

I have a toast message in my code and it shows when user enter empty dictionary name but there is a problem for me toast shows message with a default android icon and I don't want this. How can I change this icon or remove in jetpack compose kotlin ?
here is screen shot.
Hear is my code
fun updateDictionary(context: Context, dictionaryName: String): Boolean {
if (dictionaryName.isEmpty()) {
Toast.makeText(context, "Please Enter The Dictionary Name !", Toast.LENGTH_LONG).show()
return false
}
val dictionary = OwnDicEntity(dictionaryName, dicCreationTime ?: "", dicId)
updateDicUseCase.updateDic(dictionary)
return true
}
if I want to update dictionary , I go to the update screen and this function is triggered and I have to write update dictionary name if I enter empty dictionary name. it shows toast message as I wrote above.
I'm returning a boolean value, true and false, so that it doesn't update when I enter a empty value.
Starting with Android 12 you don't get any control over how Toasts look - you get two lines of text and your application icon, so the user knows where the Toast came from. (Android 11 still allows for a custom view, but only for apps in the foreground.)
If you want to change the icon, you need to add a new one for your app - the one you're seeing is the default ic_launcher drawable for a new project. Some info about that here.
If you want to remove the icon, you can't! Since you seem to be displaying this as a popup in your own app, you might want to consider a Snackbar instead, or setting the error hint on a text field, or maybe create an area of your UI dedicated to displaying any errors (e.g. if there are multiple components you need to validate, and you want the error state in one place).

Brach URL is giving "Trouble creating a URL" when tracking is disabled and trying to create a short url

For GDPR compliance reasons, we have disabled link tracking in our Android and iOS applications and using generate Short URL method for getting the short link of the item, we want to share. But when we are calling generateShortUrl() method, it gives "Trouble creating a URL. Tracking is disabled. Requested operation cannot be completed when tracking is disabled" error and the URL that is returned does not work when shared on Facebook or an email when the user clicks on it.
Our concern is though tracking is disabled and Branch is unable to create a short URL, it shall return the working long URL at least. Please let us know if we have to do something here to make it work on our apps.
Can you please check if you set generateShortUrl like the following example codes for Android? You can also find detailed information about creating deep link
Android : https://docs.branch.io/apps/android/#create-deep-link
iOS : https://docs.branch.io/apps/ios/#create-deep-link
.
import io.branch.indexing.BranchUniversalObject;
import io.branch.referral.Branch;
import io.branch.referral.BranchError;
import io.branch.referral.util.LinkProperties;
BranchUniversalObject buo = new BranchUniversalObject();
LinkProperties lp = new LinkProperties();
buo.generateShortUrl(this, lp, new Branch.BranchLinkCreateListener() {
#Override
public void onLinkCreate(String url, BranchError error) {
if (error == null) {
Log.i("BRANCH SDK", "got my Branch link to share: " + url);
}
}
});
Also, if you have any further questions, please contact support#branch.io to give better assistance.

Unable to get the alert text using selenium webdriver

I have the below code to verify the alert text and then dismiss. Verifying the alert text is failing.
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.alertIsPresent());
Alert alert = driver.switchTo().alert();
alertText = alert.getText();
alertText is returned as null. So the next step to assert the text is failing.
Next step:
driver.switchTo().alert().accept();
Accepts the alert without any issue.
Another weird scenario is when I debug in eclipse its working fine. But when I am running assertion throws error.
Another differecnce I found while running and debugging.
During running the alert come with this message don't let this page create more messages
Looks very weird.
Showing message as "don't let this page create more messages" is browser feature there to prevent sites from showing hundreds of alerts.
As while debugging your code it is working, it should work even while running too. If not working, definitely its sync issue. I hope adding some hardwait definitely help.
Other approach to get alert text from alert popup:
public String getJsAlertText()
{
Object txt = ((JavascriptExecutor)driver).executeScript("return
window.alert.myAlertText;");
return (String)txt;
}

selenium : how to handle error messages that get displayed when we dont give credentails

I am new to selenium, and when testing a web application I want to check when credentials are wrong the message in alert which gets displayed and the error message that is displayed on the page after accepting the alert are same or not please can anybody help me how can I do this
I have handled alert using
web.swichto.alert().accept
but I want to compare the message that alert displays and the error message that is displayed in that page like
Error: Invalid User ID/Password Or Network Is Down!
and message in alert box like
Invalid username/password
thanks in advance
you can store text present in the alert into a variable as follows,
String msg_in_alert=driver.switchTo().alert().getText();
then you can use assert to compare,
Assert.assertEquals(driver.findElement(By.cssSelector("selector_of_error_element")).getText().compareTo(msg_in_alert), true);
"true" specifies that the text should match..
If text does not match,it will result in step failure...
WebElement element = _driver.findElement(By.xpath("//span[#class='ng-binding error-class ng-hide']"));
element.getText();
if(element.equals("Recall and Volume data does not exist for calculation. Please upload the data.")){
System.out.println("true");
}else{
System.out.println("false");
}
WebElement mandmessActionName = driver.findElement(By.xpath("//*[#id='container']/div/form/div[1]/div/fieldset/div[1]/div/span[1]"));
String mandmessActionName1 = mandmessActionName.getText();
if (mandmessActionName1.equals("Action Name is required."))
{
System.out.println("true");
}
else
{
System.out.println("false");
}

Get a Monotouch.Dialog InputElement for a password field

I am trying to get the value from an EntryElement
var password = new EntryElement("Password","Password",null,true);
I have a StyledStringElement with a click event like
new Section()
{
new StyledStringElement ("Login", delegate {
Console.Write (string.Format("Password is {0}",password.Value));
Console.Write (string.Format("Email is {0}",email.Value));
})
When I click on the element I can see the email string value however the password is always null.
What do I need to do differently to get the password value?
make sure you have pressed return on the iPhone keyboard, if not the value will not saved