[wtr-general] How to get numbers from String?
Hi All, I am a watir newbie, its not a watir related question. Its a ruby question. sorry for this. I want to get the value 72 from below string. Showing 1 to 10 of 72 Records Please help me. Thanks Regards, Prince3105 -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: How to get numbers from String?
Hi Željko, Thanks for your instant reply. I got some a handy solution by googling. str = Showing 1 to 10 of 72 Records total_number_of_records = str.scan(/\d+/)[2].to_i Again thanks, Prince3105 On Feb 19, 3:36 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Fri, Feb 19, 2010 at 11:22 AM, Prince3105 prince3...@gmail.com wrote: Its a ruby question. sorry for this. I want to get the value 72 from below string. Showing 1 to 10 of 72 Records Ruby questions are welcome here. Although, you could get better answers at ruby list. This is one way. Let me know if you do not understand it. $ irb Showing 1 to 10 of 72 Records.split( ) = [Showing, 1, to, 10, of, 72, Records] Showing 1 to 10 of 72 Records.split( )[5] = 72 Showing 1 to 10 of 72 Records.split( )[5].to_i = 72 More information: http://ruby-doc.org/core/classes/String.html Željko -- watir.com - community manager pledgie.com/campaigns/2982 - donate to Watir watirpodcast.com - host testingpodcast.com - podcasts on software testing. all of them -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Relative path
Thanks Roshan, But i couldn't run the code. It gives me error. bad value for range (ArgumentError) So can you elaborate more? Thanks, Prince3105 On Dec 1, 11:04 am, Rohan Ojha rohan.o...@bsil.com wrote: Hi You can try this pathToTestFile = FileUtils::pwd basePath = pathToTestFile[0..(pathToTestFile.index('/Elcom'))] {Elcom is the base folder that is the outermost folder} $:.push(basePath+'Elcom/lib') {lib is the folder where I have stored my libraries} File.read(basePath+'Elcom\Elcom\test\Requistion Approval Plan\Test Data\automation.xls') {method to read the excel file which is stored } But for all this to function properly the folder structure has to be consistent throughout. Thanks Rohan Ojha -Original Message- From: Prince3105 [mailto:prince3...@gmail.com] Sent: Tuesday, December 01, 2009 10:51 AM To: Watir General Subject: [wtr-general] Relative path Hi Experts, I put my Test scripts, test data excel files and test cases file in one folder and doing testing. When i change the whole bunch to another system i am facing folder path issues. I was working QTP , where i can solve this problem by relative path. Please take a look on my below code. $excel_path = e:\\Data\\Prince\\WatIR\\iComet\\TestCases\ \StoresSpares $excel = WIN32OLE.new(excel.application) $excel['Visible'] = true; $workbook = $excel.Workbooks.Open $excel_path $worksheet = $workbook.WorkSheets(4) $worksheet.Select So after searching rdoc i found one code and it returns the current path. But am unable to open the excel file. $excel_path = Dir.getwid + \\StoresSpares it gives the current file path as below E:/Data/Prince/WatIR/iComet/TestCases\\StoresSpares So my tests are failed. I need something like below $excel_path = RelativePath+(\\StoresSpares) It may not be a watir question but i dont have more experience in ruby. So please help me to solve this issue. Thanks, Prince3105 -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines:http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Relative path
Thanks Rahul I already tried it returns the folder path but Watir expects the path like below. Otherwise it throws error due to some regular expression validation. $excel_path = e:\\Data\\Prince\\WatIR\\iComet\\TestCases\ \StoresSpares Thanks, Prince3105 On Dec 1, 2:09 pm, Rahul S. Shetty rahulshe...@bsil.com wrote: Hey Prince, Can you try this: $excel_path = Dir.getwd + '/StoresSpares' (Use single quotes and front slash) Regards, Rahul S. Shetty -Original Message- From: Prince3105 [mailto:prince3...@gmail.com] Sent: Tuesday, December 01, 2009 10:51 AM To: Watir General Subject: [wtr-general] Relative path Hi Experts, I put my Test scripts, test data excel files and test cases file in one folder and doing testing. When i change the whole bunch to another system i am facing folder path issues. I was working QTP , where i can solve this problem by relative path. Please take a look on my below code. $excel_path = e:\\Data\\Prince\\WatIR\\iComet\\TestCases\ \StoresSpares $excel = WIN32OLE.new(excel.application) $excel['Visible'] = true; $workbook = $excel.Workbooks.Open $excel_path $worksheet = $workbook.WorkSheets(4) $worksheet.Select So after searching rdoc i found one code and it returns the current path. But am unable to open the excel file. $excel_path = Dir.getwid + \\StoresSpares it gives the current file path as below E:/Data/Prince/WatIR/iComet/TestCases\\StoresSpares So my tests are failed. I need something like below $excel_path = RelativePath+(\\StoresSpares) It may not be a watir question but i dont have more experience in ruby. So please help me to solve this issue. Thanks, Prince3105 -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines:http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines:http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] Re: Relative path
Thanks Rahul Works like a charm. Thanks for your efforts. Thanks, Prince3105 On Dec 1, 3:38 pm, Rahul S. Shetty rahulshe...@bsil.com wrote: Ohk...Well then do try this...Even I have stumbled upon similar kind of issue before.. $excel_path = Dir.getwd + '/StoresSpares' $excel_path = $excel_path.gsub('/','\\') Let me know if this works. Just curious to know. Regards, Rahul S. Shetty -Original Message- From: Prince3105 [mailto:prince3...@gmail.com] Sent: Tuesday, December 01, 2009 3:59 PM To: Watir General Subject: [wtr-general] Re: Relative path Thanks Rahul I already tried it returns the folder path but Watir expects the path like below. Otherwise it throws error due to some regular expression validation. $excel_path = e:\\Data\\Prince\\WatIR\\iComet\\TestCases\ \StoresSpares Thanks, Prince3105 On Dec 1, 2:09 pm, Rahul S. Shetty rahulshe...@bsil.com wrote: Hey Prince, Can you try this: $excel_path = Dir.getwd + '/StoresSpares' (Use single quotes and front slash) Regards, Rahul S. Shetty -Original Message- From: Prince3105 [mailto:prince3...@gmail.com] Sent: Tuesday, December 01, 2009 10:51 AM To: Watir General Subject: [wtr-general] Relative path Hi Experts, I put my Test scripts, test data excel files and test cases file in one folder and doing testing. When i change the whole bunch to another system i am facing folder path issues. I was working QTP , where i can solve this problem by relative path. Please take a look on my below code. $excel_path = e:\\Data\\Prince\\WatIR\\iComet\\TestCases\ \StoresSpares $excel = WIN32OLE.new(excel.application) $excel['Visible'] = true; $workbook = $excel.Workbooks.Open $excel_path $worksheet = $workbook.WorkSheets(4) $worksheet.Select So after searching rdoc i found one code and it returns the current path. But am unable to open the excel file. $excel_path = Dir.getwid + \\StoresSpares it gives the current file path as below E:/Data/Prince/WatIR/iComet/TestCases\\StoresSpares So my tests are failed. I need something like below $excel_path = RelativePath+(\\StoresSpares) It may not be a watir question but i dont have more experience in ruby. So please help me to solve this issue. Thanks, Prince3105 -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines:http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines:http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines:http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/watir-general -- You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general
[wtr-general] How to load Ruby file in watir script
Hi All, I am using below package. Watir version - 1.6.2 Ruby version - 1.8.6 I was using IE 6 without any issues, where i used below code to clear cookies and cache memory. require 'watir/ie' require 'watir/testcase' require 'watir/cookiemanager' require 'watir\contrib\enabled_popup' require 'watir/winClicker' require 'time' require 'win32/clipboard' include Win32 Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::COOKIES) Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::INTERNET_CACHE) Above code worked well and i didn't face any issues. I installed IE 7 before two weeks and the same code is not working it doesn't throw any error at the same time it don't delete any files in the temporary folder. I ran the above snippet in IRB , it shows the list of deleted files but it didn't delete any files. After a long search i found an another snippet from below link http://rubyforge.org/snippet/detail.php?type=snippetid=26 That snippet works good. But as i am a newbie of ruby i am not able to include that snippet in Watir script. So i created one external ruby file of ClearCookiesCache.rb i stored in the same watir folder and i called in my watir script by using below code. require 'watir/ie' require 'watir/testcase' require 'watir\contrib\enabled_popup' require 'watir/winClicker' require 'time' require 'win32/clipboard' require 'ClearCookiesCache' include Win32 load 'ClearCookiesCache.rb' But it shows below warning and doesn't do anything. ./ClearCookiesCache.rb:86: warning: already initialized constant FUNCS I am running a bunch of test scripts and am creating more than 200 IE instances in the batch running. So I have to clear the cookies and cache at the end of every instances otherwise my tests will fail, so experts please take a look on my below issues. I need some advice on below areas, 1, how to clear cookies and cache? 2, how to call other ruby scripts in watir? 3, how to avoid already initialized constant errors? Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Click event not working in IE 7
Hi all, I open this thread again. I am not able to find a solution. But i tracked when this issue happens. Whenever i click submit button in my application it creates a pop-up , that time cursor is still on the application's text field and IE hangs for a while. If i manually click on any part of application or pop-up it will come back. So it happens only on pop-up comes. Has anyone faced this issue in their application please give me a solution. Thanks, Prince3105 On Oct 10, 6:37 pm, Alan Baird aba...@bairdsnet.net wrote: Prince - There isn't anything that I'm aware of that would prevent this from working. I run IE7 at work with no problems. Alan On Sat, Oct 10, 2009 at 1:04 AM, Prince3105 prince3...@gmail.com wrote: Hi Experts, I am using below package. Watir version - 1.6.2 Ruby version - 1.8.6 Recently i updated IE from 6 to 7. My scripts worked as expected in 6. The same script is not working in IE 7 especially click events. It hangs often and if i click the application or somewhere else in the monitor like task bar by manually it will work good, otherwise it will wait for a manual click event for ever. So Guys please tell me its a known issue in IE 7 ? any patches are available? if yes please post your valuable reply. Thanks, Prince3105. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Unable to create a new IE instance
Thanks Bret, Your statement is absolutely true. Just i killed the remaining IE instances before starting a new IE instance. Problem solved. Thanks, Prince3105 On Oct 13, 6:59 am, Bret Pettichord b...@pettichord.com wrote: 60 IE instances is a lot. My first guess would be that IE7 uses more memory that IE6 and that therefore you can't create as many instances of it. You might consider getting more RAM to fix your problem. Bret Prince3105 wrote: Hi ALl, I am using below package. Watir version - 1.6.2 Ruby version - 1.8.6 I am using below code for log-in in batch running. require 'watir/ie' require 'watir/testcase' require 'watir/cookiemanager' require 'watir\contrib\enabled_popup' require 'watir/winClicker' require 'time' require 'win32/clipboard' include Win32 Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::COOKIES) Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::INTERNET_CACHE) $url = http://iic66/icomettest/iCometTest13/Login.aspx; $corp_id = admin $corp_password = admin def page_login(user_id, password) @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click end class Test1 Watir::TestCase def test_a page_login($corp_id, $corp_password) # Some validation codes end end since its a batch running, this function creates more than 60 IE instances in the test and i didn't face any issues. Last week i updated my IE version from 6 to 7 and ran the script again. But that function struggled in many times and didn't created some IE instances and threw below error. But the same code worked good in IE 6, but it failed in IE 7. It failed 5 times out of 62 new IE instances. Error: test_b(Test92): WIN32OLERuntimeError: failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80004005 Unspecified error c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `initialize' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `new' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `create_browser_window' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 91:in `_new_window_init' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 87:in `initialize' StoresSpares_Masters.RB:196:in `new' StoresSpares_Masters.RB:196:in `page_login' StoresSpares_Masters.RB:424:in `test_b' So friends please take a look on my code, if any error in my code please correct it. If any workaround or some other ways are there please post it. Thanks, Prince3105 -- Bret Pettichord Lead Developer, Watir,www.watir.com Blog,www.io.com/~wazmo/blog Twitter,www.twitter.com/bpettichord --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Unable to create a new IE instance
Hi ALl, I am using below package. Watir version - 1.6.2 Ruby version - 1.8.6 I am using below code for log-in in batch running. require 'watir/ie' require 'watir/testcase' require 'watir/cookiemanager' require 'watir\contrib\enabled_popup' require 'watir/winClicker' require 'time' require 'win32/clipboard' include Win32 Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::COOKIES) Watir::CookieManager::WatirHelper.deleteSpecialFolderContents (Watir::CookieManager::WatirHelper::INTERNET_CACHE) $url = http://iic66/icomettest/iCometTest13/Login.aspx; $corp_id = admin $corp_password = admin def page_login(user_id, password) @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click end class Test1 Watir::TestCase def test_a page_login($corp_id, $corp_password) # Some validation codes end end since its a batch running, this function creates more than 60 IE instances in the test and i didn't face any issues. Last week i updated my IE version from 6 to 7 and ran the script again. But that function struggled in many times and didn't created some IE instances and threw below error. But the same code worked good in IE 6, but it failed in IE 7. It failed 5 times out of 62 new IE instances. Error: test_b(Test92): WIN32OLERuntimeError: failed to create WIN32OLE object from `InternetExplorer.Application' HRESULT error code:0x80004005 Unspecified error c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `initialize' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `new' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 167:in `create_browser_window' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 91:in `_new_window_init' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 87:in `initialize' StoresSpares_Masters.RB:196:in `new' StoresSpares_Masters.RB:196:in `page_login' StoresSpares_Masters.RB:424:in `test_b' So friends please take a look on my code, if any error in my code please correct it. If any workaround or some other ways are there please post it. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Click event not working in IE 7
Hi Experts, I am using below package. Watir version - 1.6.2 Ruby version - 1.8.6 Recently i updated IE from 6 to 7. My scripts worked as expected in 6. The same script is not working in IE 7 especially click events. It hangs often and if i click the application or somewhere else in the monitor like task bar by manually it will work good, otherwise it will wait for a manual click event for ever. So Guys please tell me its a known issue in IE 7 ? any patches are available? if yes please post your valuable reply. Thanks, Prince3105. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] SendKey focus missing in IE 7
Hi All, I am a newbie to Watir. This issue might be discussed many times, but i am unable to find a solution by searching. I am using below package. Watir version - 1.6.2 Ruby version - 1.8.6 Today i updated my IE from 6 to 7. I used send_key method extensively in the code. But when i execute the code browser's address bar got automatically focused and test failed. I tried to hide the address bar in browser but i cant. Right now i did a workaround by using Shift+Ctrl combination, but its not a worthy solution. So Experts please suggest me a solution to solve this issue. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] bring_to_front function not working...
Hi Al, I am using below code in my scripts. My script has so many sendkey operations. So i am using bring_to_front function to activate the application. But its not working and it doesn't throw any error. So please give me any other options are available in Watir like WSH's AppActivate . @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: bring_to_front function not working...
Thsnks Siva, For your instant reply, i registered and other AutoIT methods are working without any error. My actual issue is if my application is in background and if i apply bring_to_front() function it should bring the application to foreground. isn't it? but it wont bring to foreground and send key method will not work as per my wish. it doesn't throw any error. but it dont work. Thanks, Prince3105. On Oct 5, 6:51 pm, sHiVa krapa.ph...@gmail.com wrote: Hi, Did you register the AutoItx3.dll? Run the following command from command prompt. regsvr C:\ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\lib\watir \AutoItX3.dll Thanks Regards Siva Phaneendra K On Oct 5, 5:34 pm, Prince3105 prince3...@gmail.com wrote: Hi Al, I am using below code in my scripts. My script has so many sendkey operations. So i am using bring_to_front function to activate the application. But its not working and it doesn't throw any error. So please give me any other options are available in Watir like WSH's AppActivate . @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to get the Scite editor's error message in a notepad?
Hi i am a newbie to Watir, Just i want to collect the log messages from the Scite editor and save in a notepad. If any methods are available to do that please post. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to capture Errors in batch running
Hi All, I am a newbie of Watir. I have been using Watir for the past 10 months. I have created so many individual scripts and i run all those by using Scite editor and my scripts update the test results in Excel sheet, going good no issues in it. If any error occurs in the test run i can easily capture it in Scite editor so i can correct my script. I usually run my batch script by using Vbscript by using below code. Set oAutoIt = WScript.CreateObject(AutoItX3.Control) Set WshShell = WScript.CreateObject(WScript.Shell) oAutoIt.Sleep 5000 WshShell.Run E:\DATA\Prince\WatIR\iComet\Tests\StoresAndSpares \StoresSpares_Masters.RB oAutoIt.Sleep 5000 i = 0 Do Until i=10 If oAutoIt.WinExists(c:\ruby\bin\ruby.exe) Then oAutoIt.Sleep 3 else i = i + 1 End If Loop WshShell.Run E:\DATA\Prince\WatIR\iComet\Tests\StoresAndSpares \RolesRights_SS.RB oAutoIt.Sleep 5000 i = 0 Do Until i=10 If oAutoIt.WinExists(c:\ruby\bin\ruby.exe) Then oAutoIt.Sleep 3 else i = i + 1 End If Loop WshShell.Run E:\DATA\Prince\WatIR\iComet\Tests\StoresAndSpares \BPT_SS.RB Above code working good and it runs the ruby files in command prompt , but unfortunately any error occurs in the middle of the execution suddenly Ruby closes the current test and starts the next test. So i couldn't collect the error details. So if any methods available in Watir to collect the error log details please tell me. Since am a new user of Watir i couldn't use it extensively so if any easy methods or libraries are available please post it. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to check row contents?
Hi All, I am a newbie to watir. In my application after inserting the record successfully, i have yo check the data is in the grid or not. I use below code to check it. This code works good, but sometimes it fails. page = @ie.frame(:id,fmWorkflow) grid = @ie.frame(:id,fmPending).table(:id,ifgPending) tax_code = wat123 tax_description = Test tax_category= commercial page.text_field(:id,txt_typ_cd).set tax_code page.text_field(:id,tx_dscrptn).set tax_description page.text_field(:id,lkpctgry).set tax_category page.button(:id,btnSubmit).click sleep 3 record_status = false grid.body(:index, 1).each do | row | if row.text.include? tax_code.upcase and row.text.include? tax_description and row.text.include? tax_category row.flash record_status = true break end end if record_status = true puts Pass else puts Fail end So please tell me if any issue on my code. If any other ways are available to check the table row contents, please let me know. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to check row contents?
Sorry bro, I forgot to mention the error. Actually the code works good , but it returns Fail result for some success record insertion. I need know any other ways are available to check a row contents? I want to take one complete row then i have to check whether the row does have the values of tax_code, tax_code , tax_description tax_category? Apart from above code any other codes or functions are available to check one table's row? Thanks, Prince3105 On Jun 30, 3:56 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Jun 30, 2009 at 12:53 PM, Prince3105 prince3...@gmail.com wrote: This code works good, but sometimes it fails. How? grid = @ie.frame(:id,fmPending).table(:id,ifgPending) So please tell me if any issue on my code. Try this changing above line to this: def grid @ie.frame(:id,fmPending).table(:id,ifgPending) end Željko --http://watirpodcast.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to
Hi All, I use below code for login. def login(user_id, password, module_table_id, module_name, page_table_id, page_name) @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click @ie.table(:id,module_table_id).cell(:text,module_name).fire_event (onMouseOver) @ie.table(:id,page_table_id).cell(:text,page_name).click @ie.form(:id,form1).flash end Above function works good. But each and every time i have to change the module_table_id and page_table_id as per user role rights. it really kills. I want to modify the function more simple and reusable. I expect a function like below. def login(user_id, password, module_name, page_name) end I used regular expression in both table IDs, but it didnt work. So please throw some light on this issue. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to click a cell in a dynamically changing Table?
Hi All, I am a newbie to Watir and Ruby. I use below function for login process. As per user's Role Rights the user can navigate to the permitted pages. Initially user has to click the main menu, like admin, master, operation... clicking on the main menu will show allotted pages names dynamically in OnMouseOver. then he can click the page name and navigate to the particular page. Code def login(user_id, password, module_table_id, module_name, page_table_id, page_name) @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click @ie.table(:id,module_table_id).cell(:text,module_name).fire_event (onMouseOver) @ie.table(:id,page_table_id).cell(:text,page_name).click end On the above code module_table_id and page_table_id will be changed as per user. I want to modify the function as simple and reusable. I need it like below. def login(user_id, password,module_name, page_name) #code end I used Regular expression in table id but watir failed to identify the table. so i want to iterate all available tables and check all available cells finally click the page name cell. So Experts please throw some light on my request. Thanks, Prince3105. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to
Sorry mates please avoid this mail and refer another mail, in which i have described my issue clearly. @Moderator - please delete this mail. I pressed the send button accidentally. Thanks. On Apr 30, 10:07 am, Prince3105 prince3...@gmail.com wrote: Hi All, I use below code for login. def login(user_id, password, module_table_id, module_name, page_table_id, page_name) @ie = Watir::IE.new @ie.goto $url @ie.maximize @ie.bring_to_front @ie.text_field(:id,txtUserName).set user_id @ie.text_field(:id,txtPassword).set password @ie.button(:id,btnSubmit).click @ie.table(:id,module_table_id).cell(:text,module_name).fire_event (onMouseOver) @ie.table(:id,page_table_id).cell(:text,page_name).click @ie.form(:id,form1).flash end Above function works good. But each and every time i have to change the module_table_id and page_table_id as per user role rights. it really kills. I want to modify the function more simple and reusable. I expect a function like below. def login(user_id, password, module_name, page_name) end I used regular expression in both table IDs, but it didnt work. So please throw some light on this issue. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to run Tests continuously?
Hi All, I use below structure for batch running, require 'watir/ie' require 'watir/testcase' class Test1 Watir::TestCase def test_a end def test_b end end class Test2 Watir::TestCase def test_a end def test_b end def test_c end end I expect to run the tests one by one, but watir executes the code randomly, so give me a solution to execute the tests one by one in a order. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Can we check Modal dialog's properties by using Watir
Hi any idea?? On Mar 3, 10:58 am, Prince3105 prince3...@gmail.com wrote: Hi Experts, Just i want to check the modalDialog's properties like enabled, readonly... I have searched enough but cant get a solution. If is it possible of validating the properties of a ModalDialog, please post the reference url . Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Add date
Hi experts, I am a learner of Watir , my scenario is to collect the date value from a text_field then add one day or subtract one day from that day. Details are given below. i get the date from text_field as a string in dd-mmm- format(02- MAR-2009). Then i have to do add or subtract days with the string, then i have to validate the new date. below code am using to get the output. But am sure this may not be a standard coding. def date_validation( source, count, operation) start_date = source date = Date.strptime(start_date, '%d-%b-%Y') if operation == a or operation==A final_date = date + count end if operation == d or operation==D final_date = date - count end final_date = #{final_date.day}-#{final_date.month}-# {final_date.year} return final_date end date_validation(offer_approval_date, 1, A) The above code returns the value as dd-mm- format, but i need the output as dd-mmm- format(03-MAR-2009). So please modify my code if required and give me a nice solution. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to check whether table cell is enabled or not?
Any idea or workaround? please share it Thanks On Feb 18, 12:15 pm, Prince3105 prince3...@gmail.com wrote: Thanks Wesley chen, I did a mistake , actually i applied obj.readonly? method that threw error the code is below ___ if @ie.frame(:id,wfFrame).table(:id,idgEquipmentDetails).cell (:id,idgEquipmentDetails_ctl04_hndlng_amnt_nc_1).readonly? putsPass else puts Fail end above code gets below error NoMethodError: undefined method `readonly?' for #Watir::TableCell: 0x3f6f9fc If i use obj.enabled? it prints Pass instead, obj.disabled? prints Fail , but the cell is showing value only. We cant click or anything. So give me a nice solution to check cell's property of readonly... Thanks Prince3105 On Feb 18, 11:46 am, wesley chen cjq@gmail.com wrote: Is it OK object.disabled? Thanks. Wesley Chen. On Wed, Feb 18, 2009 at 2:22 PM, Prince3105 prince3...@gmail.com wrote: Hi Experts, I am a newbie to watir, in my application i have a scenario to check whether the table cells are enabled or not, after committing. I used obj.enabled? but it threw error. So please throw some light. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to append results to an existing Excel file
Hi All, I am a newbie to watir. My scenario is to validate e-mail text field with various input data which taken from a external excel sheet, then i have to write the results to the same excel sheet. In some cases i should use the same data for more than one pages, if the test gets failed i should write the results to the results column with page name, if the test gets failed in more than pages i have to append the pages name one by one in a single cell. below code i am using for single page it works good. $excel_path = e:\\Data\\Prince\\WatIR\\Test Cases\ \iTrade_Masters_Test_Report.xls $excel = WIN32OLE.new(excel.application) $excel['Visible'] = true; $workbook = $excel.Workbooks.Open $excel_path $worksheet = $workbook.WorkSheets(6) $worksheet.Select # in the middle i start the application and open the particular page until i 14 i = 1 j = 0 j = i+84 $ie.frame(:id,wfFrame).text_field(:id,txtEmail).set $worksheet.Range(e#{j})['Value'] $wsh.AppActivate(iTrade - Microsoft Internet Explorer) $wsh.SendKeys{TAB} if $ie.frame(:id,wfFrame).div (:id,PageActionPane_ValidationSummary1).li(:text,Invalid Email ID).exists? $ie.frame(:id,wfFrame).div (:id,PageActionPane_ValidationSummary1).li(:text,Invalid Email ID).flash $worksheet.Range(j#{j})['Value'] = Fail else $worksheet.Range(j#{j})['Value'] = Pass end i+=1 end I should use the same code for more than 5 pages and write the result to the same cell in append mode. If i use the same code for second page it overwrite the existing result. so give me the solution to append the results in a excel sheet's cell Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Is it possible to close the browser if the page is not loaded in given time?
Hi Experts, Please advise me, to avoid this issue can i change the ie-class file like below, def goto(url) @ie.navigate(url) sleep 20 return @down_load_time end just i changed the wait into sleep 20, will it work? My intention is browser should wait upto 20 seconds, still application is not loaded, the instance should be closed and the other instance should be started. Please post your valuable suggestion. Thanks. On Jan 13, 2:50 pm, Prince3105 prince3...@gmail.com wrote: Hi Experts, I am a newbie to Watir, am using below versions Ruby - 1.8.6-26 Final Release Watir - Watir 1.6.0 I already post a question related to this topic. In continuous test execution new page got hanged often and test gets fail. So please give me a solution , If a page is not loaded in a given time like 20 seconds, can we close the browser create a new instance and continue the process? Thanks Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Application not loaded
Hi Experts, I use below code to log the application, some time application hangs to load, that time test also gets hang and lets to fail. @ie1 = Watir::IE.new @ie1.goto $url @ie1.maximize @ie1.text_field(:name,txtUserName).set $userid @ie1.text_field(:name,txtPassword).set $password @ie1.button(:name,btnSubmit).click Just i want to alter my code like below @ie1 = Watir::IE.new @ie1.goto $url @ie1.maximize timer = 0 while password field is not exist sleep 1 timer+=1 if timer == 20 then Watir::IE.close_all() @ie1 = Watir::IE.new @ie1.goto $url @ie1.maximize end end but i cant achieve it , it hangs in the particular @ie1.goto $url line and wont move to the next line. please give me a solution. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Find Pop-up text and close function is not working
Hi Mates, After a long searching i got the solution. Instead of using complicated functions and methods, i use simple code to retrieve the text from a Web Dialog. require 'watir/ie' require 'watir\contrib\enabled_popup' require 'watir/dialog' require 'watir/winClicker' @ie = Watir::IE.new @ie.goto(http://10.1.193.109/itrade/Login.aspx;) @ie.maximize @ie.text_field(:name,txtUserName).set(wcorp) @ie.text_field(:name,txtPassword).set(wcorp123) @ie.button(:name,btnSubmit).click @ie.form(:id,form1).table(:id,tbl0).cell(:id,el6).fire_event (onMouseOver) @ie.form(:id,form1).table(:id,tbl7).cell(:id,el57).click @ie.frame(:id,plFrame).table(:id,PendingPane1_tblPP).button (:id,PendingPane1_btnNew).click @ie.frame(:id,wfFrame).button (:id,PageActionPane_btnSubmit).click_no_wait hwnd = @ie.enabled_popup(10) @ie1 = @ie.modal_dialog puts @ie1.text It retrieves the Web Dialog's text correctly.. Thanks all for your replies.. On Dec 8, 3:39 pm, Prince3105 [EMAIL PROTECTED] wrote: Hi Friends, I have searched enough, but i couldn't get the Modal dialog's error message, so mates please throw some light on this issue. I tried AutoIT.WinGetText but no use. Thanks. On Dec 1, 3:32 pm, Prince3105 [EMAIL PROTECTED] wrote: when i execute the function , popup_text[0] returns nil. Still i am searching for a solution and trying all methods in WinClicker class but not yet received a solution. So please guys give some ways to reach the target. Thanks, Prince3105 On Dec 1, 9:20 am, wesley chen [EMAIL PROTECTED] wrote: In face, you absolutely can search quite great solutions for the problem in the group. Thanks. Wesley Chen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: operator not working
Hi Friends, I got the solution, when i run the code it returns the TableCell only not the string. Then i modified the code as below and works well. real = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [2] [1] list = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [3] [1] if real.to_s == AO list.to_s == HQ puts real puts list puts Pass else putsFail puts real puts list end Thanks, Prince3105 On Dec 2, 2:01 pm, Prince3105 [EMAIL PROTECTED] wrote: Thanks for your reply, When i use first method it returns, 'AO' 'HQ' When i use length method it returns one error ADM0005.rb:20: undefined method `length' for #Watir::TableCell: 0x41bc250 (NoMethodError) But i insert one code below like a = abcd puts a.length it returns the correct answer 4. Totally i confused.. Please post a positive way.. Thanks, Prince3105 On Dec 2, 1:09 pm, LFIdnl [EMAIL PROTECTED] wrote: Or you can execute puts real.length; puts list.length . That shows you what the length of stings On 2 дек, 11:07, LFIdnl [EMAIL PROTECTED] wrote: May be your variable 'real' and 'list' have another not visible character like as whitespace. Try exucuite puts '#{real}'; puts '# {list}' . Result should be in apostrophies. On 2 дек, 10:12, Prince3105 [EMAIL PROTECTED] wrote: Hi Experts, I am totally new to Ruby and Watir. Before i was using QTP with VBscript. Today i have encountered a various problem. I have used below code to retrieve cell value from a table then i have to check these values with the actual value. version Ruby - 1.8.6-26 Final Release Watir - Watir 1.6.0 real = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [2] [1] list = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [3] [1] puts real puts list if real == AO list == HQ puts real puts list puts Pass else putsFail puts real puts list end Test gets fail and i wondering about below result. ruby ADM0005.rb AO HQ Fail AO HQ Exit code: 0 If any error on my code please let me know, if any other easy and effective way available please reply. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: operator not working
Thanks Tony for your solution, it works... Thanks, Prince3105 On Dec 2, 2:34 pm, Prince3105 [EMAIL PROTECTED] wrote: Hi Friends, I got the solution, when i run the code it returns the TableCell only not the string. Then i modified the code as below and works well. real = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [2] [1] list = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [3] [1] if real.to_s == AO list.to_s == HQ puts real puts list puts Pass else putsFail puts real puts list end Thanks, Prince3105 On Dec 2, 2:01 pm, Prince3105 [EMAIL PROTECTED] wrote: Thanks for your reply, When i use first method it returns, 'AO' 'HQ' When i use length method it returns one error ADM0005.rb:20: undefined method `length' for #Watir::TableCell: 0x41bc250 (NoMethodError) But i insert one code below like a = abcd puts a.length it returns the correct answer 4. Totally i confused.. Please post a positive way.. Thanks, Prince3105 On Dec 2, 1:09 pm, LFIdnl [EMAIL PROTECTED] wrote: Or you can execute puts real.length; puts list.length . That shows you what the length of stings On 2 дек, 11:07, LFIdnl [EMAIL PROTECTED] wrote: May be your variable 'real' and 'list' have another not visible character like as whitespace. Try exucuite puts '#{real}'; puts '# {list}' . Result should be in apostrophies. On 2 дек, 10:12, Prince3105 [EMAIL PROTECTED] wrote: Hi Experts, I am totally new to Ruby and Watir. Before i was using QTP with VBscript. Today i have encountered a various problem. I have used below code to retrieve cell value from a table then i have to check these values with the actual value. version Ruby - 1.8.6-26 Final Release Watir - Watir 1.6.0 real = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [2] [1] list = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [3] [1] puts real puts list if real == AO list == HQ puts real puts list puts Pass else putsFail puts real puts list end Test gets fail and i wondering about below result. ruby ADM0005.rb AO HQ Fail AO HQ Exit code: 0 If any error on my code please let me know, if any other easy and effective way available please reply. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: operator not working
Thanks for your reply, When i use first method it returns, 'AO' 'HQ' When i use length method it returns one error ADM0005.rb:20: undefined method `length' for #Watir::TableCell: 0x41bc250 (NoMethodError) But i insert one code below like a = abcd puts a.length it returns the correct answer 4. Totally i confused.. Please post a positive way.. Thanks, Prince3105 On Dec 2, 1:09 pm, LFIdnl [EMAIL PROTECTED] wrote: Or you can execute puts real.length; puts list.length . That shows you what the length of stings On 2 дек, 11:07, LFIdnl [EMAIL PROTECTED] wrote: May be your variable 'real' and 'list' have another not visible character like as whitespace. Try exucuite puts '#{real}'; puts '# {list}' . Result should be in apostrophies. On 2 дек, 10:12, Prince3105 [EMAIL PROTECTED] wrote: Hi Experts, I am totally new to Ruby and Watir. Before i was using QTP with VBscript. Today i have encountered a various problem. I have used below code to retrieve cell value from a table then i have to check these values with the actual value. version Ruby - 1.8.6-26 Final Release Watir - Watir 1.6.0 real = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [2] [1] list = ie.frame(:id,wfFrame).table (:id,lkpTradingPartnerType_LkpTblRows) [3] [1] puts real puts list if real == AO list == HQ puts real puts list puts Pass else putsFail puts real puts list end Test gets fail and i wondering about below result. ruby ADM0005.rb AO HQ Fail AO HQ Exit code: 0 If any error on my code please let me know, if any other easy and effective way available please reply. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Find Pop-up text and close function is not working
when i execute the function , popup_text[0] returns nil. Still i am searching for a solution and trying all methods in WinClicker class but not yet received a solution. So please guys give some ways to reach the target. Thanks, Prince3105 On Dec 1, 9:20 am, wesley chen [EMAIL PROTECTED] wrote: In face, you absolutely can search quite great solutions for the problem in the group. Thanks. Wesley Chen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Is it possible to run all tests one by one
Hi i am newbie to WatIR, I have been using QTP for the past two years and recently concentrating on WatIR. Please clear my doubt. In QTP we can run multiple tests as per our requirement by using multi test manager. In WatIR is any UI available to run tests as per our wish, like continuous play, on failure run next test, or close application If Is it possible to run multiple tests in WatIR please let me know. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Please review - Text.Exist method
Hi Experts, I am using below code to check a particular text is exist in a page. Please review the code whether it is a good one or not. Give me your valuable suggestion to write effective codes. require 'watir' ie = Watir::IE.new ie.goto(http://10.1.193.109/itrade/Login.aspx;) ie.maximize ie.text_field(:name,txtUserName).set(wcorp) ie.text_field(:name,txtPassword).set(wcorp123) ie.button(:name,btnSubmit).click ie.form(:id,form1).table(:id,tbl0).cell(:id,el6).click ie.form(:id,form1).table(:id,tbl0).cell(:id,el6).fire_event (onMouseOver) ie.form(:id,form1).table(:id,tbl7).cell(:id,el59).click ie.form(:id,form1).span(:text,Organisation).flash if ie.text.include? Organisation puts Pass else puts Fail end ie.form(:id,form1).link(:text,Logout).click I am having one doubt, If the same text existing more than one time in the same page how can we identify it? Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] How to check a text_field focus status
Hi Experts, I am a newbie to WatIR. Can we check whether a text field is focused or not. If is it possible please post the solution. Thanks, Prince3105 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---