This forum is in read-only mode. The new forum is live at and registrations are open!

js code in selenium | parsing a value

  • hey
    i want to know in js pages how can i realize the failure way
    in another way

    in the page there is this code in page

    <header class="alert-text ng-scope" ng-switch-default="" style=""><h1>Please check the email and password.</h1><p>The email address and password combination you entered is incorrect. Please try again.</p></header>

    so this code always is available in source,and just when login worng,it come up with red color
    so i want to know how can i make ob to realize this "Please check the email and password" is the failure key ,and it findout the red error title came up

  • check what change when it's failure,if it come with red colour try to use that thing as failure or try to check if the url or cookie change when it's failure and when it's success.

  • you can either use the HTML code responsible for the red color along with the accompanied text as a failure key or see the difference in the headers or cookies between the success and failure responses and use em as keys

  • @sabbirgf2 as i said all changes are available while even dont login as a invalid account because its java script,all there is in source and just when try to login depend to success or fail it comes up to show
    so cant use that changes as a fail key because even login successfully that there be in source too

  • @Fairy yeah thats good idea
    but how can i get headers in selenium?? for cookie there is "Get cookie" but cant find anything for headers

Log in to reply