Unable to click on button in rediff.com website at user login page - selenium-webdriver

Unable to click on button after entering the email address.
driver = new ChromeDriver();
driver.get("http://in.rediff.com/");
driver.findElement(By.xpath(".//*[#id='homewrapper']/div[5]/a[3]/div/u")).click();
driver.findElement(By.xpath(".//*[#id='wrapper']/div[2]/ul/li[2]/a")).click();
driver.findElement(By.xpath(".//*[#id='useremail']")).sendKeys("xyz");
driver.findElement(By.xpath(".//*[#id='emailsubmit']")).click();
I am supposed to see the password input box after the submit button click. For somereason I am not able to see this. Am I doing anything wrong? Not getting any errors after this line.
System.out.println("Finish");
This line is executed as well.

Your code is clicking on the Submit button perfectly.
As per the rediff functionality, if "xyz"(username) you are entering doesnt exist, then it will redirect to Login form.
So the reason you are not getting password object. Try with any existing user account(username).

Related

Not able to select element in appium

There is app called Raaga. I'm trying to automate this application using Appium and selenium but when I launched the app after splash screen a popup comes asking "Choose account for Raaga" as soon as the popup gone then there is screen which ask for login and sign up stuff but when I try to find the element it always throw no element found. Please let me know if m wrong I'm new to this. Thanks.
Here is my code:
TouchAction act = new TouchAction(driver);
act.tap(241,320).perform();
synchronized (driver)
{
driver.wait(4000);
}
driver.findElementByAndroidUIAutomator("new UiSelector().text(\"SIGN IN\")").click();
Here is first screen where the pop up comes
This is second screen which comes after the popup and I want to click on the "SIGN IN" button
Screenshot of UiAutomator with SIGN IN button selected.
So, you should try by using resource-id or xpath
driver.findElement(By.id("user_signin_btn")).click();
or
driver.findElement(By.id("com.raaga.android:id/user_signin_btn")).click();
or
driver.findElement(By.xpath("//*[#text='SIGN IN']")).click();

not able to click the login button through selenium

please create a selenium code for us where i am not able to hit the Login Button. see my code below and do the correction :
driver.findElement(By.id("Log In")).click();
driver.findElement(By.className("submit")).click();
driver.findElement(By.cssSelector(".sbt-btn-wrap relative .submit")).click();
driver.findElement(By.className("formButton")).click();
Try this below xpath.
Explanation: User value attribute of input tag.
driver.findElement(By.xpath("//input[#value='Log In']")).click();
For click on Lock and Edit button use this code.
driver.findElement(By.xpath("//input[#value='Lock & Edit']")).click();

Set a variable to null whenever a user clicks the back button to a particular page in ionic

I am trying to set a variable to set a variable to null whenever a user clicks the back button after signing in. So I am doing this but it is not working as the variable still shows on that Page which is the signin page
var currentUserNow = localStorage.getItem("username")
alert(currentUserNow);
localStorage.removeItem("userDetail");
localStorage.removeItem("username");
$urlRouterProvider.otherwise('/sign-in');
Now I want to ask is there anyhow I can tell that the user has clicked the back button to a particular page and set that variable to null
if you are trying to disable the back button in login page.
then try in login.html
<ion-content hide-back-button="true">

Error when clicking Add-button in CRUD

When a form or an add-button returns to a page, it throws an error or shows wrong output on the page, if there is js or other kinds of output on the page. Here is an example:
$tabs->addTab('Skoler')->add('CRUD')->setModel('School');
$crud=$tabs->addTab('Elever')->add('CRUD');
$crud->setModel($student);
if($crud->grid){
$crud->grid->addButton('addStudents')->set('Importer elever')->js('click',$this->js()->univ()
->dialogURL('Importer elever',$this->api->url('importusers&usertype=student'))
->execute());;
$crud->grid->js(true)->addClass('reloadstudent');
$crud->grid->js('.reloadstudent')->reload();
}
When clicking on "Add School" This outputs
$('#barometeradmin_mgr').univ().dialogURL('Importer elever','/redskab/barometer/admin/?page=importusers\x26usertype=student\x26barometeradmin_mgr_tabs_view_htmlelement_crud_virtualpage=add')
in the dialogurl created by the button.
Is there a way to check if the page is loaded for the second time (that is, by the button).
Thanks!
Jeppe
I think all you need to do is leave out the '->execute()'?

DRUPAL 7 - How can I hide content from non logged in user?

I want to show a message to any anonymous user who try accessing a page, something on the lines of "login to view page" with a link to log in.
By searching, I am only getting to hide completely a page from anonymous users, but I want the page the title, or the link to the page visible; when users clicks on it, it displays an error message similar to "Please login to view this page."
I want the same for the attachments: Users can see the attached file, but when they try to download it, the error message "Please login to view this page." should be shown.
You can simly edit your theme code where you output the page, for example in node.tpl.php
you can add:
global $user;
if($user->uid){
// code for the logged user output the content
}
else{
print '<div class="yourstyle">custom message</div>';
}

Resources