Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
HemaPen
Posts : 7
Join date : 2013-06-20

Login to twitter account  Empty Login to twitter account

Thu Jun 20, 2013 6:21 pm
hi, 

I have started my automation project since 2 days. I need to login to twitter account and verify or click on feedpost.
While I am trying to login to twitter, it is taking me to "We gotta check are you human?" page. Since this page
includes image and text to be input for verification, I dont know how to solve this.
Has anyone faced this problem? How can I avoid this authentication.

This doesnt happen when I login to facebook account.

If anyone has information, please reply as I am stuck at this point.

Thanks,
avatar
lkavitha
Posts : 1
Join date : 2013-06-22

Login to twitter account  Empty Re: Login to twitter account

Sat Jun 22, 2013 3:57 am
There is a article related to your question, the author has tried rewriting the expected captcha hidden value using javascript, and then did a sendKey to set the actual value (as done by user usually). Something similar should be possible as the twitter site also has a "recaptcha_challenge_field" that stores a hidden value and i am anticipating it to contain the expected value. Yet to try, when time permits

To reach the article do a google for "Automating(Breaking) captcha using Selenium Webdriver", click on the first link.
avatar
sree.cs10@gmail.com
Posts : 3
Join date : 2013-06-10
Age : 35
Location : Hyderabad

Login to twitter account  Empty Twitter Login Script

Sat Jun 22, 2013 10:08 pm
Hi HemaPen,

I am able to login to Twitter account successfully without taking me to Captcha page. Can you pls try the below code, and let me know if you face any issues.. 

***************
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.By;

public class LoginToTwitter {
public static void main(String[] args) throws Exception {
WebDriver fd=new FirefoxDriver();
fd.get("https://twitter.com");
fd.findElement(By.xpath("/html/body/div/div[2]/div/div/div[3]/div[2]/form/div/label"))
.sendKeys("twitter-userid");
fd.findElement(By.xpath("/html/body/div/div[2]/div/div/div[3]/div[2]/form/table/tbody/tr/td/div/label"))
.sendKeys("twitter-pwd");
fd.findElement(By.xpath("/html/body/div/div[2]/div/div/div[3]/div[2]/form/table/tbody/tr/td[2]/button")).click();
}
}
***************
avatar
HemaPen
Posts : 7
Join date : 2013-06-20

Login to twitter account  Empty Re: Login to twitter account

Mon Jun 24, 2013 10:57 am
Hi Sree and Kavitha,


Thank you for your reply.

I am using chrome driver and By.id(). Ideally none of this should matter. 
But still I could not login without captcha screen popping up.

However, when I tried with WebdriverBackedSlenium, I could login successfully without getting captcha screen.

I will have to look at breaking captcha and learn to break if in case I run into captcha anytime.

Thanks again for your reply,
Hema
Sponsored content

Login to twitter account  Empty Re: Login to twitter account

Back to top
Permissions in this forum:
You cannot reply to topics in this forum