lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
506 stars 115 forks source link

canopy << (write) does seem to work with gmail #password box. #438

Closed manishdube closed 6 years ago

manishdube commented 6 years ago

I am scratching my head on this and pretty embarrassed that i am not able to get this working. but this seems tricker than what it looks...

Below scenario i am trying to log in to gmail.com with the given username and password but the password field does not take the string values for some reason and it times out. How do i work around this issue.

"Given I log in to gmail.com with username 'abc@gmail.com and password 'abc' "&&& fun _ ->
    url "https://www.gmail.com" 
    "#identifierId" << "abc@gmail.com"
    click "Next"
    "#password" << "abc"
manishdube commented 6 years ago

i do have the latest chromedriver too?

manishdube commented 6 years ago

Is there a way to use

press Keys. and type in the letters in the password box?

lefthandedgoat commented 6 years ago

#password is a div. You need to use input[type='password']

manishdube commented 6 years ago

worked. (feeling stupid).

how do i learn this div thing better.

manishdube commented 6 years ago

Are there examples on your turtle tests that show the different ways to use locators. Sorry. getting frustrated with sticky locators and not knowing how to use them with canopy fully well.

lefthandedgoat commented 6 years ago

Here are the built in locators in canopy:

https://github.com/lefthandedgoat/canopy/blob/master/src/canopy/finders.fs#L99-L105

There are three main types of selectors CSS (the ones used on css style sheets) XPath (from XML, html is a a type of XML) JQuery (additional selectors like css selectors added by jquery, like :first)

The yellow part of this page has all of the css/jquery selectors: https://oscarotero.com/jquery/

You should learn HTML, and how to use the Chrome Dev Tools, they will make your life easier.

manishdube commented 6 years ago

many thanks again. This is tremendous stuff and am the biggest Canopy fan !