premanand_r
11 years agoOccasional Contributor
Cannot able to do cross browser testing
we recorded a page in our application in IE and we get the script as :
Call Aliases.browser.ToUrl("http://example.abc.com/")
Call Aliases.browser.pageTips.formFrmlogin.table.textboxTxtemailaddr.Keys("aaa@abc.com")
'Enters '[Tab]' in the 'textboxTxtemailaddr' object.
Call Aliases.browser.pageTips.formFrmlogin.table.textboxTxtemailaddr.Keys("[Tab]")
'Sets the text 'test1234' in the 'passwordboxTxtpassword' text editor.
Call Aliases.browser.pageTips.formFrmlogin.table.passwordboxTxtpassword.Keys("abc")
'Clicks at point (27, 9) of the 'imagebuttonImgbtnlogin' object.
Call Aliases.browser.pageTips.formFrmlogin.table.imagebuttonImgbtnlogin.Click(27, 9)
But this code when we run in other browsers like firefox and chrome it is not working.
The same page we recorded in chrome and firefox and got the code as
firefox:
Call Aliases.firefox.wndMozillaWindowClass.Click(165, 106)
Call Aliases.firefox.wndMozillaWindowClass.Keys("http://example.abc.com[Enter]")
Call Aliases.firefox.wndMozillaWindowClass.Keys("aaa@abc.com[Tab]")
Call Aliases.firefox.wndMozillaWindowClass.Keys("abc")
Call Aliases.firefox.wndMozillaWindowClass.Click(649, 489)
chrome:
Call Aliases.browser.BrowserWindow.Keys("http://example.abc.com[Enter]")
Call Aliases.browser.BrowserWindow.Click(648, 325)
'Enters 'test@preludesys.com[Tab]' in the 'BrowserWindow' object.
Call Aliases.browser.BrowserWindow.Keys("aaa@abc.com[Tab]")
'Clicks at point (641, 354) of the 'BrowserWindow' object.
Call Aliases.browser.BrowserWindow.Click(641, 354)
'Enters 'test1234' in the 'BrowserWindow' object.
Call Aliases.browser.BrowserWindow.Keys("abc")
'Clicks at point (636, 440) of the 'BrowserWindow' object.
Call Aliases.browser.BrowserWindow.Click(636, 440)
we have to do cross browser testing for this functionality using a single script for all browsers.Please help .
Regards
prem
Call Aliases.browser.ToUrl("http://example.abc.com/")
Call Aliases.browser.pageTips.formFrmlogin.table.textboxTxtemailaddr.Keys("aaa@abc.com")
'Enters '[Tab]' in the 'textboxTxtemailaddr' object.
Call Aliases.browser.pageTips.formFrmlogin.table.textboxTxtemailaddr.Keys("[Tab]")
'Sets the text 'test1234' in the 'passwordboxTxtpassword' text editor.
Call Aliases.browser.pageTips.formFrmlogin.table.passwordboxTxtpassword.Keys("abc")
'Clicks at point (27, 9) of the 'imagebuttonImgbtnlogin' object.
Call Aliases.browser.pageTips.formFrmlogin.table.imagebuttonImgbtnlogin.Click(27, 9)
But this code when we run in other browsers like firefox and chrome it is not working.
The same page we recorded in chrome and firefox and got the code as
firefox:
Call Aliases.firefox.wndMozillaWindowClass.Click(165, 106)
Call Aliases.firefox.wndMozillaWindowClass.Keys("http://example.abc.com[Enter]")
Call Aliases.firefox.wndMozillaWindowClass.Keys("aaa@abc.com[Tab]")
Call Aliases.firefox.wndMozillaWindowClass.Keys("abc")
Call Aliases.firefox.wndMozillaWindowClass.Click(649, 489)
chrome:
Call Aliases.browser.BrowserWindow.Keys("http://example.abc.com[Enter]")
Call Aliases.browser.BrowserWindow.Click(648, 325)
'Enters 'test@preludesys.com[Tab]' in the 'BrowserWindow' object.
Call Aliases.browser.BrowserWindow.Keys("aaa@abc.com[Tab]")
'Clicks at point (641, 354) of the 'BrowserWindow' object.
Call Aliases.browser.BrowserWindow.Click(641, 354)
'Enters 'test1234' in the 'BrowserWindow' object.
Call Aliases.browser.BrowserWindow.Keys("abc")
'Clicks at point (636, 440) of the 'BrowserWindow' object.
Call Aliases.browser.BrowserWindow.Click(636, 440)
we have to do cross browser testing for this functionality using a single script for all browsers.Please help .
Regards
prem
- Your code should look like this:
Browsers.Item(btFirefox).Run("http://example.abc.com");
Sys.Browser().Page("http://example.abc.com/").Panel("container").Form("frmLogin").Panel("rt_content").Panel("login").Table(0).Cell(5, 1).ImageButton("imgbtnLogin").Click();
The only thing you should change to test in another browser is replace "btFirefox" to "btIExplorer" or "btChrome".
When you use Browsers.Item(...).Run or Browsers.Item(...).Navigate TestComplete sets specified browser as Browsers.CurrentBrowser and uses it as default when calling Sys.Browser() without parameters.