Using Testwise to automate other websites

43 views
Skip to first unread message

Irfan Arif

unread,
Nov 28, 2015, 2:13:56 PM11/28/15
to TestWise

Hi

I have brought a few books starting with Practical test automation. I am new beginner. I have also brought the recipe books.

I am trying to put the theory into practice using http://store.demoqa.com ecommerce website.

I am using the approach of using the recorder to start with and have come across an issue where what has been recorded is breaking when it reached the pop up where I have two boxes which one says Go to checkout and other continue shopping. I will paste the code below from the testwise recorder. Now I can see form the inspector it looks like a pop up but as a new comer how do I resolve this. I have looked at a the selnuim webriver ruby snippets around the javascript and tried those but now luck.  When one gets stuck on issue like this what is the best strategy to resolve issues as these?

Any help appreciated. 

 25: driver.find_element(:link_text, "iPhone 5").click                                         (works)
 26: driver.find_element(:xpath,"//input[@value='Add To Cart']").click                 (works)
 27: driver.find_element(:link_text, "Go to Checkout").click                                (this fails below)     
Error
Unable to locate element: {"method":"link text","selector":"Go to Checkout"}[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdr...@googlecode.com/components/driver-component.js:10271:in `FirefoxDriver.prototype.findElementInternal_'
[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdr...@googlecode.com/components/driver-component.js:10280:in `FirefoxDriver.prototype.findElement'
[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdr...@googlecode.com/components/command-processor.js:12274:in `DelayedCommand.prototype.executeInternal_/h'
[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver

Zhimin

unread,
Nov 30, 2015, 12:47:31 AM11/30/15
to TestWise
Hi,  I would recommend you getting the recipe test scripts from http://zhimin.com/books/selenium-recipes  (sign in with your LeanPub invoice number). You shall  be able to find the answer to your two questions (the other popup related) there. 

Zhimin

On Sunday, 29 November 2015 05:13:56 UTC+10, Irfan Arif wrote:

Hi

I have brought a few books starting with Practical test automation. I am new beginner. I have also brought the recipe books.

I am trying to put the theory into practice using http://store.demoqa.com ecommerce website.

I am using the approach of using the recorder to start with and have come across an issue where what has been recorded is breaking when it reached the pop up where I have two boxes which one says Go to checkout and other continue shopping. I will paste the code below from the testwise recorder. Now I can see form the inspector it looks like a pop up but as a new comer how do I resolve this. I have looked at a the selnuim webriver ruby snippets around the javascript and tried those but now luck.  When one gets stuck on issue like this what is the best strategy to resolve issues as these?

Any help appreciated. 

 25: driver.find_element(:link_text, "iPhone 5").click                                         (works)
 26: driver.find_element(:xpath,"//input[@value='Add To Cart']").click                 (works)
 27: driver.find_element(:link_text, "Go to Checkout").click                                (this fails below)     
Error
Unable to locate element: {"method":"link text","selector":"Go to Checkout"}[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdriver@googlecode.com/components/driver-component.js:10271:in `FirefoxDriver.prototype.findElementInternal_'
[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdriver@googlecode.com/components/driver-component.js:10280:in `FirefoxDriver.prototype.findElement'
[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdriver@googlecode.com/components/command-processor.js:12274:in `DelayedCommand.prototype.executeInternal_/h'

Irfan Arif

unread,
Nov 30, 2015, 4:17:08 AM11/30/15
to TestWise
Hi,

I did look into the selenium-recipes book and did try the javascript snippets but could not get it working. In the end I placed a simple sleep statement before clicking to the Go to check out button which appears to have done the trick.


On Saturday, November 28, 2015 at 7:13:56 PM UTC, Irfan Arif wrote:

Hi

I have brought a few books starting with Practical test automation. I am new beginner. I have also brought the recipe books.

I am trying to put the theory into practice using http://store.demoqa.com ecommerce website.

I am using the approach of using the recorder to start with and have come across an issue where what has been recorded is breaking when it reached the pop up where I have two boxes which one says Go to checkout and other continue shopping. I will paste the code below from the testwise recorder. Now I can see form the inspector it looks like a pop up but as a new comer how do I resolve this. I have looked at a the selnuim webriver ruby snippets around the javascript and tried those but now luck.  When one gets stuck on issue like this what is the best strategy to resolve issues as these?

Any help appreciated. 

 25: driver.find_element(:link_text, "iPhone 5").click                                         (works)
 26: driver.find_element(:xpath,"//input[@value='Add To Cart']").click                 (works)
 27: driver.find_element(:link_text, "Go to Checkout").click                                (this fails below)     
Error
Unable to locate element: {"method":"link text","selector":"Go to Checkout"}[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdriver@googlecode.com/components/driver-component.js:10271:in `FirefoxDriver.prototype.findElementInternal_'
[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdriver@googlecode.com/components/driver-component.js:10280:in `FirefoxDriver.prototype.findElement'
[remote server] file:///C:/Users/arifi/AppData/Local/Temp/webdriver-profile20151128-11404-1ti3uld/extensions/fxdriver@googlecode.com/components/command-processor.js:12274:in `DelayedCommand.prototype.executeInternal_/h'

Zhimin

unread,
Nov 30, 2015, 4:55:12 AM11/30/15
to TestWise

Please tell me which recipe does not work for you, in which chapter. And how did it not working for you.  

Irfan Arif

unread,
Nov 30, 2015, 8:55:05 AM11/30/15
to TestWise
Hi Zhimin,

It probably not the scripts not working and me being new and not knowing more then anything. I will keep playing. 
Reply all
Reply to author
Forward
0 new messages